kitchen-simulator 4.4.6 → 5.0.0-new-api.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/LiteRenderer.js +15 -53
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/img/default/maple.jpg +0 -0
- package/es/assets/img/default/steel.jpg +0 -0
- package/es/catalog/catalog.js +0 -2
- package/es/catalog/factories/area-factory-3d.js +0 -4
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/utils/exporter.js +2 -0
- package/es/catalog/utils/item-loader.js +0 -4
- package/es/class/area.js +0 -1
- package/es/class/export.js +1 -3
- package/es/class/item.js +17 -6
- package/es/components/content.js +1 -3
- package/es/components/style/export.js +2 -28
- package/es/components/viewer2d/line.js +2 -2
- package/es/components/viewer2d/viewer2d.js +0 -1
- package/es/components/viewer3d/front3D.js +1 -2
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/es/components/viewer3d/scene-creator.js +0 -1
- package/es/components/viewer3d/three-memory-cleaner.js +0 -14
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/constants.js +11 -6
- package/es/devLiteRenderer.js +124 -84
- package/es/mappings/external-events/mapExternalEventPayload.js +28 -0
- package/es/mappings/external-events/mappers/addItemMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfToCDSMapper.js +31 -0
- package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +37 -0
- package/es/mappings/external-events/mappers/loadProjectMapper.js +62 -0
- package/es/mappings/holesToCatalog.js +139 -0
- package/es/models.js +12 -1
- package/es/plugins/keyboard.js +1 -1
- package/es/reducers/export.js +2 -4
- package/es/reducers/items-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -3
- package/es/shared/objects/immutable.js +3 -0
- package/es/utils/geometry.js +276 -74
- package/es/utils/history.js +2 -2
- package/es/utils/isolate-event-handler.js +57 -45
- package/es/utils/molding.js +5 -3
- package/lib/LiteRenderer.js +17 -55
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/img/default/maple.jpg +0 -0
- package/lib/assets/img/default/steel.jpg +0 -0
- package/lib/catalog/catalog.js +0 -2
- package/lib/catalog/factories/area-factory-3d.js +0 -4
- package/lib/catalog/holes/door-double/door_double.png +0 -0
- package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
- package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/lib/catalog/holes/gate/gate.jpg +0 -0
- package/lib/catalog/holes/window-clear/texture.png +0 -0
- package/lib/catalog/holes/window-cross/texture.png +0 -0
- package/lib/catalog/holes/window-double-hung/texture.png +0 -0
- package/lib/catalog/holes/window-vertical/texture.png +0 -0
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/catalog/utils/item-loader.js +0 -4
- package/lib/class/area.js +0 -1
- package/lib/class/export.js +0 -8
- package/lib/class/item.js +17 -6
- package/lib/components/content.js +1 -3
- package/lib/components/style/export.js +1 -105
- package/lib/components/viewer2d/line.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1
- package/lib/components/viewer3d/front3D.js +1 -2
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/lib/components/viewer3d/scene-creator.js +0 -1
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -14
- package/lib/constants.js +16 -11
- package/lib/devLiteRenderer.js +126 -86
- package/lib/mappings/external-events/mapExternalEventPayload.js +33 -0
- package/lib/mappings/external-events/mappers/addItemMapper.js +92 -0
- package/lib/mappings/external-events/mappers/ccdfMapper.js +93 -0
- package/lib/mappings/external-events/mappers/ccdfToCDSMapper.js +37 -0
- package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +44 -0
- package/lib/mappings/external-events/mappers/loadProjectMapper.js +70 -0
- package/lib/mappings/holesToCatalog.js +148 -0
- package/lib/models.js +12 -1
- package/lib/reducers/export.js +1 -9
- package/lib/reducers/reducer.js +0 -1
- package/lib/shared/objects/immutable.js +9 -0
- package/lib/utils/geometry.js +276 -74
- package/lib/utils/history.js +1 -1
- package/lib/utils/isolate-event-handler.js +57 -45
- package/lib/utils/molding.js +5 -3
- package/package.json +1 -1
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -79
- package/es/class/FuseUtils.js +0 -79
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-text-input.js +0 -69
- package/es/reducers/user-reducer.js +0 -41
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/catalog/utils/FuseUtils.js +0 -87
- package/lib/class/FuseUtils.js +0 -87
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
package/es/utils/geometry.js
CHANGED
|
@@ -2132,8 +2132,6 @@ export function relationshipOfTwoOverlappedLines2(srcLine, destLine) {
|
|
|
2132
2132
|
};
|
|
2133
2133
|
var line0 = [p1, p2].sort(comparator);
|
|
2134
2134
|
var line1 = [p3, p4].sort(comparator);
|
|
2135
|
-
var isReversedSrcLineDirection = false;
|
|
2136
|
-
if (line0[0].x === srcLine.x2 && line0[0].y === srcLine.y2) isReversedSrcLineDirection = true;
|
|
2137
2135
|
var _sort3 = [line0, line1].sort(function (lineA, lineB) {
|
|
2138
2136
|
return comparator(lineA[0], lineB[0]);
|
|
2139
2137
|
}),
|
|
@@ -2141,101 +2139,305 @@ export function relationshipOfTwoOverlappedLines2(srcLine, destLine) {
|
|
|
2141
2139
|
lineSX = _sort4[0],
|
|
2142
2140
|
lineDX = _sort4[1];
|
|
2143
2141
|
var isReversedSrcLineIdx = false;
|
|
2144
|
-
if (lineSX[0].x === line0[0].x && lineSX[0].y === line0[0].y) isReversedSrcLineIdx = false;
|
|
2145
|
-
|
|
2142
|
+
if (lineSX[0].x === line0[0].x && lineSX[0].y === line0[0].y) isReversedSrcLineIdx = false; // SX=srcLine, DX=destLine
|
|
2143
|
+
else if (lineSX[0].x === line1[0].x && lineSX[0].y === line1[0].y) isReversedSrcLineIdx = true; // DX=srcLine, SX=destLine
|
|
2144
|
+
|
|
2145
|
+
var compare0 = comparator(lineSX[0], lineDX[0]); // always <= 0
|
|
2146
2146
|
var compare1 = comparator(lineSX[1], lineDX[0]);
|
|
2147
2147
|
var compare2 = comparator(lineSX[1], lineDX[1]);
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
//
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2148
|
+
var sp = null,
|
|
2149
|
+
ep = null;
|
|
2150
|
+
if (MathUtils.fAbs(compare1) < EPSILON) {
|
|
2151
|
+
// SX
|
|
2152
|
+
// |----------|
|
|
2153
|
+
// DX
|
|
2154
|
+
// |------------|
|
|
2155
|
+
// link : lineSX[0] - lineDX[1]
|
|
2156
|
+
if (lineSX[0].x === p1.x && lineSX[0].y === p1.y || lineDX[1].x === p2.x && lineDX[1].y === p2.y) {
|
|
2157
|
+
sp = {
|
|
2158
|
+
x: lineSX[0].x,
|
|
2159
|
+
y: lineSX[0].y
|
|
2160
|
+
};
|
|
2161
|
+
ep = {
|
|
2162
|
+
x: lineDX[1].x,
|
|
2163
|
+
y: lineDX[1].y
|
|
2164
|
+
};
|
|
2165
|
+
} else {
|
|
2166
|
+
// srcLine Direction is reversed
|
|
2167
|
+
sp = {
|
|
2168
|
+
x: lineDX[1].x,
|
|
2169
|
+
y: lineDX[1].y
|
|
2170
|
+
};
|
|
2171
|
+
ep = {
|
|
2172
|
+
x: lineSX[0].x,
|
|
2173
|
+
y: lineSX[0].y
|
|
2159
2174
|
};
|
|
2160
2175
|
}
|
|
2161
|
-
// else {
|
|
2162
|
-
// // src includes dest
|
|
2163
|
-
// // return OVERLAP_SOME; // lineSX[1] - lineDX[1]
|
|
2164
|
-
// return {
|
|
2165
|
-
// result: OVERLAP_SOME,
|
|
2166
|
-
// trimmedSegs: {
|
|
2167
|
-
// x1: lineSX[1].x,
|
|
2168
|
-
// y1: lineSX[1].y,
|
|
2169
|
-
// x2: lineDX[1].x,
|
|
2170
|
-
// y2: lineDX[1].y
|
|
2171
|
-
// }
|
|
2172
|
-
// };
|
|
2173
|
-
// }
|
|
2174
|
-
}
|
|
2175
|
-
if (MathUtils.fAbs(compare1) < EPSILON) {
|
|
2176
|
-
// return OVERLAP_LINK; // lineSX[1]
|
|
2177
2176
|
return {
|
|
2178
2177
|
result: OVERLAP_LINK,
|
|
2179
2178
|
linkedLine: {
|
|
2180
|
-
x1:
|
|
2181
|
-
y1:
|
|
2182
|
-
x2:
|
|
2183
|
-
y2:
|
|
2179
|
+
x1: sp.x,
|
|
2180
|
+
y1: sp.y,
|
|
2181
|
+
x2: ep.x,
|
|
2182
|
+
y2: ep.y
|
|
2184
2183
|
}
|
|
2185
2184
|
};
|
|
2186
2185
|
} else if (compare1 < 0) {
|
|
2186
|
+
// SX
|
|
2187
|
+
// |----------|
|
|
2188
|
+
// DX
|
|
2189
|
+
// |----------|
|
|
2190
|
+
// none
|
|
2187
2191
|
return {
|
|
2188
2192
|
result: OVERLAP_NONE
|
|
2189
2193
|
};
|
|
2190
|
-
} else {
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2194
|
+
} else if (MathUtils.fAbs(compare0) < EPSILON && MathUtils.fAbs(compare2) < EPSILON) {
|
|
2195
|
+
// SX
|
|
2196
|
+
// |----------|
|
|
2197
|
+
// DX
|
|
2198
|
+
// |----------|
|
|
2199
|
+
return {
|
|
2200
|
+
result: OVERLAP_SAME
|
|
2201
|
+
};
|
|
2202
|
+
} else if (MathUtils.fAbs(compare0) < EPSILON) {
|
|
2203
|
+
if (compare2 < 0 && isReversedSrcLineIdx) {
|
|
2204
|
+
// SX
|
|
2205
|
+
// |---------------|
|
|
2206
|
+
// DX
|
|
2207
|
+
// |-----------------------|
|
|
2208
|
+
// DX includes SX, DX=srcLine, SX=destLine : sx1 - dx1
|
|
2209
|
+
if (lineDX[1].x === p2.x && lineDX[1].y === p2.y) {
|
|
2210
|
+
sp = {
|
|
2211
|
+
x: lineSX[1].x,
|
|
2212
|
+
y: lineSX[1].y
|
|
2213
|
+
};
|
|
2214
|
+
ep = {
|
|
2215
|
+
x: lineDX[1].x,
|
|
2216
|
+
y: lineDX[1].y
|
|
2217
|
+
};
|
|
2218
|
+
} else {
|
|
2219
|
+
// srcLine Direction is reversed
|
|
2220
|
+
sp = {
|
|
2221
|
+
x: lineDX[1].x,
|
|
2222
|
+
y: lineDX[1].y
|
|
2223
|
+
};
|
|
2224
|
+
ep = {
|
|
2225
|
+
x: lineSX[1].x,
|
|
2226
|
+
y: lineSX[1].y
|
|
2227
|
+
};
|
|
2228
|
+
}
|
|
2229
|
+
return {
|
|
2230
|
+
result: OVERLAP_SOME,
|
|
2231
|
+
trimmedSegs: [{
|
|
2232
|
+
x1: sp.x,
|
|
2233
|
+
y1: sp.y,
|
|
2234
|
+
x2: ep.x,
|
|
2235
|
+
y2: ep.y
|
|
2236
|
+
}]
|
|
2237
|
+
};
|
|
2238
|
+
} else if (compare2 > 0 && !isReversedSrcLineIdx) {
|
|
2239
|
+
// SX
|
|
2240
|
+
// |-----------------------|
|
|
2241
|
+
// DX
|
|
2242
|
+
// |---------------|
|
|
2243
|
+
// SX includes DX, SX=srcLine, DX=destLine : dx1 - sx1
|
|
2244
|
+
if (lineSX[1].x === p2.x && lineSX[1].y === p2.y) {
|
|
2245
|
+
sp = {
|
|
2246
|
+
x: lineDX[1].x,
|
|
2247
|
+
y: lineDX[1].y
|
|
2248
|
+
};
|
|
2249
|
+
ep = {
|
|
2250
|
+
x: lineSX[1].x,
|
|
2251
|
+
y: lineSX[1].y
|
|
2252
|
+
};
|
|
2253
|
+
} else {
|
|
2254
|
+
// srcLine Direction is reversed
|
|
2255
|
+
sp = {
|
|
2256
|
+
x: lineSX[1].x,
|
|
2257
|
+
y: lineSX[1].y
|
|
2258
|
+
};
|
|
2259
|
+
ep = {
|
|
2260
|
+
x: lineDX[1].x,
|
|
2261
|
+
y: lineDX[1].y
|
|
2262
|
+
};
|
|
2263
|
+
}
|
|
2264
|
+
return {
|
|
2265
|
+
result: OVERLAP_SOME,
|
|
2266
|
+
trimmedSegs: [{
|
|
2267
|
+
x1: sp.x,
|
|
2268
|
+
y1: sp.y,
|
|
2269
|
+
x2: ep.x,
|
|
2270
|
+
y2: ep.y
|
|
2271
|
+
}]
|
|
2272
|
+
};
|
|
2273
|
+
} else {
|
|
2274
|
+
// srcLine
|
|
2275
|
+
// |---------------|
|
|
2276
|
+
// destLine
|
|
2277
|
+
// |-----------------------|
|
|
2278
|
+
// destLine includes srcLine
|
|
2279
|
+
return {
|
|
2280
|
+
result: OVERLAP_INCLUDED
|
|
2281
|
+
};
|
|
2282
|
+
}
|
|
2283
|
+
} else if (MathUtils.fAbs(compare2) < EPSILON) {
|
|
2284
|
+
// SX
|
|
2285
|
+
// |-----------------------|
|
|
2286
|
+
// DX
|
|
2287
|
+
// |------------------|
|
|
2288
|
+
if (isReversedSrcLineIdx) {
|
|
2289
|
+
// SX includes DX, DX=srcLine, SX=destLine
|
|
2290
|
+
// destLine includes srcLine
|
|
2291
|
+
return {
|
|
2292
|
+
result: OVERLAP_INCLUDED
|
|
2293
|
+
};
|
|
2294
|
+
} else {
|
|
2295
|
+
// SX includes DX, SX=srcLine, DX=destLine
|
|
2296
|
+
// srcLine incluedes destLine : sx0 - dx0
|
|
2297
|
+
if (lineSX[1].x === p2.x && lineSX[1].y === p2.y) {
|
|
2298
|
+
sp = {
|
|
2299
|
+
x: lineSX[0].x,
|
|
2300
|
+
y: lineSX[0].y
|
|
2301
|
+
};
|
|
2302
|
+
ep = {
|
|
2303
|
+
x: lineDX[0].x,
|
|
2304
|
+
y: lineDX[0].y
|
|
2305
|
+
};
|
|
2306
|
+
} else {
|
|
2307
|
+
// srcLine direction is reversed
|
|
2308
|
+
sp = {
|
|
2309
|
+
x: lineDX[0].x,
|
|
2310
|
+
y: lineDX[0].y
|
|
2311
|
+
};
|
|
2312
|
+
ep = {
|
|
2313
|
+
x: lineSX[0].x,
|
|
2314
|
+
y: lineSX[0].y
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
return {
|
|
2318
|
+
result: OVERLAP_SOME,
|
|
2319
|
+
trimmedSegs: [{
|
|
2320
|
+
x1: sp.x,
|
|
2321
|
+
y1: sp.y,
|
|
2322
|
+
x2: ep.x,
|
|
2323
|
+
y2: ep.y
|
|
2324
|
+
}]
|
|
2325
|
+
};
|
|
2326
|
+
}
|
|
2327
|
+
} else if (compare0 < 0 && compare2 > 0) {
|
|
2328
|
+
// SX
|
|
2329
|
+
// |-----------------------|
|
|
2330
|
+
// DX
|
|
2331
|
+
// |----------------|
|
|
2332
|
+
if (isReversedSrcLineIdx) {
|
|
2333
|
+
// SX includes DX, DX=srcLine, SX=destLine
|
|
2334
|
+
// destLine includes srcLine
|
|
2335
|
+
return {
|
|
2336
|
+
result: OVERLAP_INCLUDED
|
|
2337
|
+
};
|
|
2338
|
+
} else {
|
|
2339
|
+
// SX includes DX, SX=srcLine, DX=destLine
|
|
2340
|
+
// srcLine incluedes destLine : sx0 - dx0, dx1 - sx1
|
|
2341
|
+
if (lineSX[1].x === p2.x && lineSX[1].y === p2.y) {
|
|
2196
2342
|
return {
|
|
2197
|
-
result:
|
|
2343
|
+
result: OVERLAP_SOME,
|
|
2344
|
+
trimmedSegs: [{
|
|
2345
|
+
x1: lineSX[0].x,
|
|
2346
|
+
y1: lineSX[0].y,
|
|
2347
|
+
x2: lineDX[0].x,
|
|
2348
|
+
y2: lineDX[0].y
|
|
2349
|
+
}, {
|
|
2350
|
+
x1: lineDX[1].x,
|
|
2351
|
+
y1: lineDX[1].y,
|
|
2352
|
+
x2: lineSX[1].x,
|
|
2353
|
+
y2: lineSX[1].y
|
|
2354
|
+
}]
|
|
2198
2355
|
};
|
|
2199
2356
|
} else {
|
|
2200
|
-
//
|
|
2201
|
-
var trimmedSegs = [];
|
|
2202
|
-
// return OVERLAP_SOME; // lineSX[0] - lineDX[0], lineDX[1] - lineSX[1]
|
|
2203
|
-
if (compare0 < 0) trimmedSegs.push({
|
|
2204
|
-
x1: isReversedSrcLineDirection ? lineDX[0].x : lineSX[0].x,
|
|
2205
|
-
y1: isReversedSrcLineDirection ? lineDX[0].y : lineSX[0].y,
|
|
2206
|
-
x2: isReversedSrcLineDirection ? lineSX[0].x : lineDX[0].x,
|
|
2207
|
-
y2: isReversedSrcLineDirection ? lineSX[0].y : lineDX[0].y
|
|
2208
|
-
});
|
|
2209
|
-
if (compare2 > 0) trimmedSegs.push({
|
|
2210
|
-
x1: isReversedSrcLineDirection ? lineSX[1].x : lineDX[1].x,
|
|
2211
|
-
y1: isReversedSrcLineDirection ? lineSX[1].y : lineDX[1].y,
|
|
2212
|
-
x2: isReversedSrcLineDirection ? lineDX[1].x : lineSX[1].x,
|
|
2213
|
-
y2: isReversedSrcLineDirection ? lineDX[1].y : lineSX[1].y
|
|
2214
|
-
});
|
|
2357
|
+
// srcLine direction is reversed
|
|
2215
2358
|
return {
|
|
2216
2359
|
result: OVERLAP_SOME,
|
|
2217
|
-
trimmedSegs:
|
|
2360
|
+
trimmedSegs: [{
|
|
2361
|
+
x1: lineDX[0].x,
|
|
2362
|
+
y1: lineDX[0].y,
|
|
2363
|
+
x2: lineSX[0].x,
|
|
2364
|
+
y2: lineSX[0].y
|
|
2365
|
+
}, {
|
|
2366
|
+
x1: lineSX[1].x,
|
|
2367
|
+
y1: lineSX[1].y,
|
|
2368
|
+
x2: lineDX[1].x,
|
|
2369
|
+
y2: lineDX[1].y
|
|
2370
|
+
}]
|
|
2218
2371
|
};
|
|
2219
2372
|
}
|
|
2220
2373
|
}
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2374
|
+
} else if (compare2 < 0) {
|
|
2375
|
+
// SX
|
|
2376
|
+
// |-----------------------|
|
|
2377
|
+
// DX
|
|
2378
|
+
// |----------------------------|
|
|
2379
|
+
// overlap some
|
|
2380
|
+
if (isReversedSrcLineIdx) {
|
|
2381
|
+
// DX=srcLine, SX=destLine
|
|
2382
|
+
if (lineDX[1].x === p2.x && lineDX[1].y === p2.y) {
|
|
2383
|
+
sp = {
|
|
2384
|
+
x: lineSX[1].x,
|
|
2385
|
+
y: lineSX[1].y
|
|
2386
|
+
};
|
|
2387
|
+
ep = {
|
|
2388
|
+
x: lineDX[1].x,
|
|
2389
|
+
y: lineDX[1].y
|
|
2390
|
+
};
|
|
2391
|
+
} else {
|
|
2392
|
+
// srcLine direction is reversed
|
|
2393
|
+
sp = {
|
|
2394
|
+
x: lineDX[1].x,
|
|
2395
|
+
y: lineDX[1].y
|
|
2396
|
+
};
|
|
2397
|
+
ep = {
|
|
2398
|
+
x: lineSX[1].x,
|
|
2399
|
+
y: lineSX[1].y
|
|
2400
|
+
};
|
|
2401
|
+
}
|
|
2402
|
+
return {
|
|
2403
|
+
result: OVERLAP_SOME,
|
|
2404
|
+
trimmedSegs: [{
|
|
2405
|
+
x1: sp.x,
|
|
2406
|
+
y1: sp.y,
|
|
2407
|
+
x2: ep.x,
|
|
2408
|
+
y2: ep.y
|
|
2409
|
+
}]
|
|
2410
|
+
};
|
|
2411
|
+
} else {
|
|
2412
|
+
// SX=srcLine, DX=destLine
|
|
2413
|
+
if (lineSX[1].x === p2.x && lineSX[1].y === p2.y) {
|
|
2414
|
+
sp = {
|
|
2415
|
+
x: lineSX[0].x,
|
|
2416
|
+
y: lineSX[0].y
|
|
2417
|
+
};
|
|
2418
|
+
ep = {
|
|
2419
|
+
x: lineDX[0].x,
|
|
2420
|
+
y: lineDX[0].y
|
|
2421
|
+
};
|
|
2422
|
+
} else {
|
|
2423
|
+
// srcLine direction is reversed
|
|
2424
|
+
sp = {
|
|
2425
|
+
x: lineDX[0].x,
|
|
2426
|
+
y: lineDX[0].y
|
|
2427
|
+
};
|
|
2428
|
+
ep = {
|
|
2429
|
+
x: lineSX[0].x,
|
|
2430
|
+
y: lineSX[0].y
|
|
2431
|
+
};
|
|
2432
|
+
}
|
|
2236
2433
|
return {
|
|
2237
2434
|
result: OVERLAP_SOME,
|
|
2238
|
-
trimmedSegs:
|
|
2435
|
+
trimmedSegs: [{
|
|
2436
|
+
x1: sp.x,
|
|
2437
|
+
y1: sp.y,
|
|
2438
|
+
x2: ep.x,
|
|
2439
|
+
y2: ep.y
|
|
2440
|
+
}]
|
|
2239
2441
|
};
|
|
2240
2442
|
}
|
|
2241
2443
|
}
|
package/es/utils/history.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Map, List } from 'immutable';
|
|
2
2
|
import diff from 'immutablediff';
|
|
3
3
|
import patch from 'immutablepatch';
|
|
4
4
|
export var historyPush = function historyPush(historyStructure, item) {
|
|
@@ -11,7 +11,7 @@ export var historyPush = function historyPush(historyStructure, item) {
|
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
// convert map to object of the [value] field
|
|
14
|
-
if (List.isList(toPush.get('diff')) && ((_toPush$get = toPush.get('diff')) === null || _toPush$get === void 0 ? void 0 : _toPush$get.size) >
|
|
14
|
+
if (List.isList(toPush.get('diff')) && ((_toPush$get = toPush.get('diff')) === null || _toPush$get === void 0 ? void 0 : _toPush$get.size) > 0) {
|
|
15
15
|
for (var i = 0; i < toPush.get('diff').size; i++) {
|
|
16
16
|
var mapValue = toPush.get('diff').get(i).get('value');
|
|
17
17
|
if (Map.isMap(mapValue)) {
|