kitchen-simulator 1.1.1-test.6 → 1.1.1-test.61
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/@history.js +10 -2
- package/es/AppContext.js +10 -3
- package/es/KitchenConfigurator.js +95 -106
- package/es/KitchenConfiguratorApp.js +145 -154
- package/es/actions/area-actions.js +12 -5
- package/es/actions/export.js +29 -12
- package/es/actions/groups-actions.js +45 -27
- package/es/actions/holes-actions.js +55 -34
- package/es/actions/items-actions.js +145 -94
- package/es/actions/lines-actions.js +36 -21
- package/es/actions/project-actions.js +145 -94
- package/es/actions/scene-actions.js +21 -11
- package/es/actions/vertices-actions.js +15 -7
- package/es/actions/viewer2d-actions.js +36 -21
- package/es/actions/viewer3d-actions.js +18 -9
- package/es/catalog/areas/area/planner-element.js +18 -8
- package/es/catalog/catalog.js +21 -24
- package/es/catalog/factories/area-factory-3d.js +31 -22
- package/es/catalog/factories/area-factory.js +20 -14
- package/es/catalog/factories/export.js +24 -6
- package/es/catalog/factories/wall-factory-3d.js +41 -31
- package/es/catalog/factories/wall-factory.js +31 -21
- package/es/catalog/holes/door-closet/planner-element.js +24 -15
- package/es/catalog/holes/door-double/planner-element.js +24 -15
- package/es/catalog/holes/door-exterior/planner-element.js +25 -16
- package/es/catalog/holes/door-interior/planner-element.js +25 -16
- package/es/catalog/holes/door-panic/planner-element.js +16 -7
- package/es/catalog/holes/door-panic-double/planner-element.js +24 -15
- package/es/catalog/holes/door-sliding/planner-element.js +25 -16
- package/es/catalog/holes/doorway-framed/planner-element.js +20 -11
- package/es/catalog/holes/doorway-frameless/planner-element.js +16 -7
- package/es/catalog/holes/export.js +97 -13
- package/es/catalog/holes/window-clear/planner-element.js +19 -10
- package/es/catalog/holes/window-cross/planner-element.js +19 -10
- package/es/catalog/holes/window-double-hung/planner-element.js +19 -10
- package/es/catalog/holes/window-vertical/planner-element.js +19 -10
- package/es/catalog/lines/wall/planner-element.js +21 -11
- package/es/catalog/molding/molding-dcm/planner-element.js +14 -5
- package/es/catalog/molding/molding-fbm/planner-element.js +14 -5
- package/es/catalog/molding/molding-lrm/planner-element.js +14 -5
- package/es/catalog/properties/export.js +80 -20
- package/es/catalog/properties/property-checkbox.js +84 -35
- package/es/catalog/properties/property-color.js +23 -16
- package/es/catalog/properties/property-enum.js +72 -28
- package/es/catalog/properties/property-hidden.js +16 -9
- package/es/catalog/properties/property-lenght-measure.js +45 -39
- package/es/catalog/properties/property-length-measure.js +84 -34
- package/es/catalog/properties/property-length-measure_hole.js +45 -39
- package/es/catalog/properties/property-number.js +24 -17
- package/es/catalog/properties/property-read-only.js +23 -16
- package/es/catalog/properties/property-string.js +23 -16
- package/es/catalog/properties/property-toggle.js +23 -16
- package/es/catalog/properties/shared-property-style.js +7 -1
- package/es/catalog/utils/FuseUtils.js +15 -11
- package/es/catalog/utils/exporter.js +15 -11
- package/es/catalog/utils/geom-utils.js +29 -13
- package/es/catalog/utils/item-loader.js +97 -91
- package/es/catalog/utils/load-obj.js +28 -20
- package/es/catalog/utils/mtl-loader.js +9 -3
- package/es/catalog/utils/obj-loader.js +9 -3
- package/es/class/FuseUtils.js +15 -11
- package/es/class/area.js +28 -26
- package/es/class/export.js +95 -23
- package/es/class/group.js +59 -62
- package/es/class/guide.js +21 -19
- package/es/class/hole.js +89 -88
- package/es/class/item.js +150 -155
- package/es/class/layer.js +65 -63
- package/es/class/line.js +143 -144
- package/es/class/project.js +98 -94
- package/es/class/vertex.js +35 -33
- package/es/components/content.js +29 -19
- package/es/components/disclaimer/disclaimer.js +80 -92
- package/es/components/export.js +32 -8
- package/es/components/style/button.js +31 -30
- package/es/components/style/cancel-button.js +14 -8
- package/es/components/style/content-container.js +16 -12
- package/es/components/style/content-title.js +20 -15
- package/es/components/style/delete-button.js +17 -9
- package/es/components/style/export.js +120 -30
- package/es/components/style/form-block.js +15 -12
- package/es/components/style/form-color-input.js +14 -8
- package/es/components/style/form-label.js +15 -12
- package/es/components/style/form-number-input.js +73 -47
- package/es/components/style/form-number-input_2.js +44 -42
- package/es/components/style/form-select.js +60 -14
- package/es/components/style/form-slider.js +38 -16
- package/es/components/style/form-submit-button.js +17 -9
- package/es/components/style/form-text-input.js +57 -37
- package/es/components/viewer2d/area.js +24 -17
- package/es/components/viewer2d/export.js +120 -30
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +17 -11
- package/es/components/viewer2d/grids/grid-streak.js +17 -11
- package/es/components/viewer2d/grids/grid-vertical-streak.js +17 -11
- package/es/components/viewer2d/grids/grids.js +19 -15
- package/es/components/viewer2d/group.js +24 -15
- package/es/components/viewer2d/item.js +70 -68
- package/es/components/viewer2d/layer.js +30 -23
- package/es/components/viewer2d/line.js +111 -104
- package/es/components/viewer2d/ruler.js +29 -23
- package/es/components/viewer2d/rulerDist.js +28 -21
- package/es/components/viewer2d/rulerX.js +47 -45
- package/es/components/viewer2d/rulerY.js +45 -43
- package/es/components/viewer2d/scene.js +42 -46
- package/es/components/viewer2d/snap.js +22 -13
- package/es/components/viewer2d/state.js +27 -23
- package/es/components/viewer2d/utils.js +65 -21
- package/es/components/viewer2d/vertex.js +17 -8
- package/es/components/viewer2d/viewer2d.js +171 -166
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -24
- package/es/components/viewer3d/dcm.js +7 -1
- package/es/components/viewer3d/fbm.js +7 -1
- package/es/components/viewer3d/front3D.js +21 -17
- package/es/components/viewer3d/grid-creator.js +17 -8
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +14 -6
- package/es/components/viewer3d/grids/grid-streak.js +13 -5
- package/es/components/viewer3d/grids/grid-vertical-streak.js +14 -6
- package/es/components/viewer3d/libs/first-person-controls.js +9 -2
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +7 -1
- package/es/components/viewer3d/libs/mtl-loader.js +8 -2
- package/es/components/viewer3d/libs/obj-loader.js +8 -2
- package/es/components/viewer3d/libs/orbit-controls.js +12 -5
- package/es/components/viewer3d/libs/pointer-lock-controls.js +11 -4
- package/es/components/viewer3d/lrm.js +7 -1
- package/es/components/viewer3d/model.js +7 -1
- package/es/components/viewer3d/pointer-lock-navigation.js +10 -3
- package/es/components/viewer3d/ruler-utils/itemRect.js +25 -18
- package/es/components/viewer3d/ruler-utils/layer3D.js +66 -59
- package/es/components/viewer3d/ruler-utils/ruler3D.js +46 -42
- package/es/components/viewer3d/ruler-utils/scene3D.js +18 -11
- package/es/components/viewer3d/ruler-utils/state3D.js +11 -4
- package/es/components/viewer3d/scene-creator.js +227 -198
- package/es/components/viewer3d/three-memory-cleaner.js +12 -3
- package/es/components/viewer3d/viewer3d-first-person.js +46 -46
- package/es/components/viewer3d/viewer3d.js +208 -209
- package/es/constants.js +358 -349
- package/es/index.js +28 -15
- package/es/models.js +185 -183
- package/es/plugins/SVGLoader.js +53 -48
- package/es/plugins/autosave.js +9 -3
- package/es/plugins/console-debugger.js +12 -8
- package/es/plugins/export.js +32 -8
- package/es/plugins/keyboard.js +35 -29
- package/es/reducers/areas-reducer.js +13 -7
- package/es/reducers/export.js +96 -24
- package/es/reducers/groups-reducer.js +37 -31
- package/es/reducers/holes-reducer.js +49 -43
- package/es/reducers/items-reducer.js +112 -109
- package/es/reducers/lines-reducer.js +34 -28
- package/es/reducers/project-reducer.js +111 -105
- package/es/reducers/reducer.js +23 -16
- package/es/reducers/scene-reducer.js +21 -15
- package/es/reducers/user-reducer.js +11 -6
- package/es/reducers/vertices-reducer.js +17 -11
- package/es/reducers/viewer2d-reducer.js +24 -18
- package/es/reducers/viewer3d-reducer.js +22 -16
- package/es/shared-style.js +16 -10
- package/es/styles/export.js +11 -3
- package/es/translator/en.js +7 -1
- package/es/translator/it.js +7 -1
- package/es/translator/ru.js +7 -1
- package/es/translator/translator.js +19 -17
- package/es/utils/browser.js +9 -2
- package/es/utils/convert-units-lite.js +35 -0
- package/es/utils/email-validator.js +7 -1
- package/es/utils/export.js +46 -15
- package/es/utils/geometry.js +279 -191
- package/es/utils/get-edges-of-subgraphs.js +9 -1
- package/es/utils/graph-cycles.js +11 -9
- package/es/utils/graph-inner-cycles.js +18 -10
- package/es/utils/graph.js +17 -12
- package/es/utils/helper.js +63 -109
- package/es/utils/history.js +15 -8
- package/es/utils/id-broker.js +15 -12
- package/es/utils/logger.js +7 -1
- package/es/utils/math.js +12 -5
- package/es/utils/molding.js +177 -158
- package/es/utils/name-generator.js +13 -11
- package/es/utils/objects-utils.js +19 -7
- package/es/utils/phone-validator.js +7 -1
- package/es/utils/process-black-list.js +10 -6
- package/es/utils/react-if.js +12 -6
- package/es/utils/snap-scene.js +34 -32
- package/es/utils/snap.js +59 -51
- package/es/utils/summarizeCart.js +7 -1
- package/es/utils/threeCSG.es6.js +22 -17
- package/es/version.js +7 -1
- package/lib/@history.js +1 -1
- package/lib/AppContext.js +1 -1
- package/lib/KitchenConfigurator.js +68 -87
- package/lib/KitchenConfiguratorApp.js +94 -110
- package/lib/actions/export.js +1 -1
- package/lib/catalog/areas/area/planner-element.js +12 -8
- package/lib/catalog/catalog.js +7 -15
- package/lib/catalog/factories/area-factory-3d.js +1 -1
- package/lib/catalog/factories/area-factory.js +4 -6
- package/lib/catalog/factories/export.js +1 -1
- package/lib/catalog/factories/wall-factory-3d.js +4 -4
- package/lib/catalog/factories/wall-factory.js +2 -2
- package/lib/catalog/holes/door-closet/planner-element.js +2 -2
- package/lib/catalog/holes/door-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-exterior/planner-element.js +2 -2
- package/lib/catalog/holes/door-interior/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic/planner-element.js +2 -2
- package/lib/catalog/holes/door-panic-double/planner-element.js +2 -2
- package/lib/catalog/holes/door-sliding/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-framed/planner-element.js +2 -2
- package/lib/catalog/holes/doorway-frameless/planner-element.js +2 -2
- package/lib/catalog/holes/export.js +14 -14
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/holes/window-cross/planner-element.js +2 -2
- package/lib/catalog/holes/window-double-hung/planner-element.js +2 -2
- package/lib/catalog/holes/window-vertical/planner-element.js +2 -2
- package/lib/catalog/lines/wall/planner-element.js +15 -11
- package/lib/catalog/molding/molding-dcm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-fbm/planner-element.js +2 -2
- package/lib/catalog/molding/molding-lrm/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +1 -1
- package/lib/catalog/properties/property-checkbox.js +66 -24
- package/lib/catalog/properties/property-color.js +1 -1
- package/lib/catalog/properties/property-enum.js +52 -15
- package/lib/catalog/properties/property-hidden.js +1 -1
- package/lib/catalog/properties/property-lenght-measure.js +8 -9
- package/lib/catalog/properties/property-length-measure.js +59 -16
- package/lib/catalog/properties/property-length-measure_hole.js +8 -9
- package/lib/catalog/properties/property-number.js +1 -1
- package/lib/catalog/properties/property-read-only.js +1 -1
- package/lib/catalog/properties/property-string.js +1 -1
- package/lib/catalog/properties/property-toggle.js +1 -1
- package/lib/catalog/utils/FuseUtils.js +8 -10
- package/lib/catalog/utils/exporter.js +8 -11
- package/lib/catalog/utils/geom-utils.js +1 -1
- package/lib/catalog/utils/item-loader.js +29 -35
- package/lib/catalog/utils/mtl-loader.js +7 -3
- package/lib/catalog/utils/obj-loader.js +7 -3
- package/lib/class/FuseUtils.js +8 -10
- package/lib/class/area.js +7 -10
- package/lib/class/export.js +1 -1
- package/lib/class/group.js +11 -19
- package/lib/class/guide.js +9 -12
- package/lib/class/hole.js +5 -8
- package/lib/class/item.js +23 -34
- package/lib/class/layer.js +5 -8
- package/lib/class/line.js +12 -19
- package/lib/class/project.js +8 -10
- package/lib/class/vertex.js +7 -10
- package/lib/components/content.js +3 -2
- package/lib/components/disclaimer/disclaimer.js +67 -87
- package/lib/components/export.js +1 -1
- package/lib/components/style/button.js +15 -21
- package/lib/components/style/cancel-button.js +5 -6
- package/lib/components/style/content-container.js +3 -6
- package/lib/components/style/content-title.js +8 -11
- package/lib/components/style/delete-button.js +6 -7
- package/lib/components/style/export.js +1 -1
- package/lib/components/style/form-block.js +7 -11
- package/lib/components/style/form-color-input.js +5 -6
- package/lib/components/style/form-label.js +7 -11
- package/lib/components/style/form-number-input.js +41 -22
- package/lib/components/style/form-number-input_2.js +13 -18
- package/lib/components/style/form-select.js +51 -14
- package/lib/components/style/form-slider.js +26 -11
- package/lib/components/style/form-submit-button.js +6 -7
- package/lib/components/style/form-text-input.js +44 -31
- package/lib/components/viewer2d/area.js +6 -6
- package/lib/components/viewer2d/export.js +1 -1
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +1 -2
- package/lib/components/viewer2d/grids/grid-streak.js +1 -2
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +1 -2
- package/lib/components/viewer2d/grids/grids.js +4 -9
- package/lib/components/viewer2d/group.js +2 -2
- package/lib/components/viewer2d/item.js +12 -18
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +4 -7
- package/lib/components/viewer2d/ruler.js +7 -8
- package/lib/components/viewer2d/rulerDist.js +5 -5
- package/lib/components/viewer2d/rulerX.js +13 -18
- package/lib/components/viewer2d/rulerY.js +13 -18
- package/lib/components/viewer2d/scene.js +22 -33
- package/lib/components/viewer2d/snap.js +2 -2
- package/lib/components/viewer2d/state.js +5 -10
- package/lib/components/viewer2d/utils.js +35 -2
- package/lib/components/viewer2d/vertex.js +2 -2
- package/lib/components/viewer2d/viewer2d.js +38 -40
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +14 -20
- package/lib/components/viewer3d/front3D.js +4 -9
- package/lib/components/viewer3d/grid-creator.js +2 -2
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-streak.js +1 -1
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +1 -1
- package/lib/components/viewer3d/libs/mtl-loader.js +6 -2
- package/lib/components/viewer3d/libs/obj-loader.js +6 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +10 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +9 -4
- package/lib/components/viewer3d/pointer-lock-navigation.js +1 -1
- package/lib/components/viewer3d/ruler-utils/itemRect.js +8 -8
- package/lib/components/viewer3d/ruler-utils/layer3D.js +33 -33
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +3 -6
- package/lib/components/viewer3d/ruler-utils/scene3D.js +4 -5
- package/lib/components/viewer3d/ruler-utils/state3D.js +1 -1
- package/lib/components/viewer3d/scene-creator.js +40 -45
- package/lib/components/viewer3d/three-memory-cleaner.js +1 -1
- package/lib/components/viewer3d/viewer3d-first-person.js +11 -16
- package/lib/components/viewer3d/viewer3d.js +32 -37
- package/lib/index.js +22 -88
- package/lib/models.js +58 -63
- package/lib/plugins/console-debugger.js +3 -6
- package/lib/plugins/export.js +1 -1
- package/lib/reducers/export.js +1 -1
- package/lib/reducers/user-reducer.js +0 -1
- package/lib/reducers/viewer2d-reducer.js +3 -4
- package/lib/reducers/viewer3d-reducer.js +3 -4
- package/lib/styles/export.js +1 -1
- package/lib/translator/translator.js +5 -9
- package/lib/utils/convert-units-lite.js +35 -0
- package/lib/utils/export.js +2 -2
- package/lib/utils/geometry.js +20 -28
- package/lib/utils/get-edges-of-subgraphs.js +7 -1
- package/lib/utils/graph-cycles.js +9 -9
- package/lib/utils/graph-inner-cycles.js +1 -1
- package/lib/utils/graph.js +15 -12
- package/lib/utils/helper.js +14 -83
- package/lib/utils/history.js +1 -1
- package/lib/utils/id-broker.js +7 -10
- package/lib/utils/molding.js +66 -71
- package/lib/utils/name-generator.js +5 -8
- package/lib/utils/objects-utils.js +5 -3
- package/lib/utils/process-black-list.js +3 -5
- package/lib/utils/react-if.js +1 -1
- package/lib/utils/snap-scene.js +3 -7
- package/lib/utils/snap.js +22 -26
- package/lib/utils/threeCSG.es6.js +14 -14
- package/package.json +24 -54
- package/es/analytics/ga4.js +0 -191
- package/es/analytics/posthog.js +0 -60
- package/lib/analytics/ga4.js +0 -197
- package/lib/analytics/posthog.js +0 -68
package/es/class/line.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _immutable = require("immutable");
|
|
13
|
+
var _export = require("./export");
|
|
14
|
+
var _export2 = require("../utils/export");
|
|
15
|
+
var Three = _interopRequireWildcard(require("three"));
|
|
16
|
+
var _constants = require("../constants");
|
|
17
|
+
var _helper = require("../utils/helper");
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
19
|
var timeGlobal = 0;
|
|
20
20
|
var TimeRecorder = /*#__PURE__*/function () {
|
|
21
21
|
function TimeRecorder(name) {
|
|
22
|
-
|
|
22
|
+
(0, _classCallCheck2["default"])(this, TimeRecorder);
|
|
23
23
|
this.name = name;
|
|
24
24
|
if (name === 'beginDrawingLine') {
|
|
25
25
|
console.log('time__ Start Drawing');
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return (0, _createClass2["default"])(TimeRecorder, [{
|
|
29
29
|
key: "start",
|
|
30
30
|
value: function start() {
|
|
31
31
|
this.first = Date.now();
|
|
@@ -44,11 +44,11 @@ var TimeRecorder = /*#__PURE__*/function () {
|
|
|
44
44
|
}
|
|
45
45
|
}]);
|
|
46
46
|
}();
|
|
47
|
-
var Line = /*#__PURE__*/function () {
|
|
47
|
+
var Line = exports["default"] = /*#__PURE__*/function () {
|
|
48
48
|
function Line() {
|
|
49
|
-
|
|
49
|
+
(0, _classCallCheck2["default"])(this, Line);
|
|
50
50
|
}
|
|
51
|
-
return
|
|
51
|
+
return (0, _createClass2["default"])(Line, null, [{
|
|
52
52
|
key: "create",
|
|
53
53
|
value: function create(state, layerID, type, x0, y0, x1, y1, properties) {
|
|
54
54
|
var lineCreatedDateTime = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : new Date().getTime();
|
|
@@ -57,18 +57,18 @@ var Line = /*#__PURE__*/function () {
|
|
|
57
57
|
// return { updatedState: state };
|
|
58
58
|
// }
|
|
59
59
|
// ///////////////
|
|
60
|
-
var lineID = IDBroker.acquireID();
|
|
61
|
-
var _Vertex$add = Vertex.add(state, layerID, x0, y0, 'lines', lineID),
|
|
60
|
+
var lineID = _export2.IDBroker.acquireID();
|
|
61
|
+
var _Vertex$add = _export.Vertex.add(state, layerID, x0, y0, 'lines', lineID),
|
|
62
62
|
stateV0 = _Vertex$add.updatedState,
|
|
63
63
|
v0 = _Vertex$add.vertex;
|
|
64
|
-
var _Vertex$add2 = Vertex.add(stateV0, layerID, x1, y1, 'lines', lineID),
|
|
64
|
+
var _Vertex$add2 = _export.Vertex.add(stateV0, layerID, x1, y1, 'lines', lineID),
|
|
65
65
|
stateV1 = _Vertex$add2.updatedState,
|
|
66
66
|
v1 = _Vertex$add2.vertex;
|
|
67
67
|
state = stateV1;
|
|
68
68
|
var line = state.catalog.factoryElement(type, {
|
|
69
69
|
id: lineID,
|
|
70
|
-
name: NameGenerator.generateName('lines', state.catalog.getIn(['elements', type, 'info', 'title'])),
|
|
71
|
-
vertices: new List([v0.id, v1.id]),
|
|
70
|
+
name: _export2.NameGenerator.generateName('lines', state.catalog.getIn(['elements', type, 'info', 'title'])),
|
|
71
|
+
vertices: new _immutable.List([v0.id, v1.id]),
|
|
72
72
|
type: type
|
|
73
73
|
}, properties);
|
|
74
74
|
line = line.set('createdDateTime', lineCreatedDateTime !== undefined ? lineCreatedDateTime : new Date().getTime());
|
|
@@ -90,7 +90,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
90
90
|
value: function select(state, layerID, lineID) {
|
|
91
91
|
var _line$vertices, _line$vertices$get, _line$vertices2, _line$vertices2$get;
|
|
92
92
|
// Try selecting the layer first
|
|
93
|
-
var layerResult = Layer.select(state, layerID);
|
|
93
|
+
var layerResult = _export.Layer.select(state, layerID);
|
|
94
94
|
if (!layerResult || !layerResult.updatedState) {
|
|
95
95
|
return {
|
|
96
96
|
updatedState: state
|
|
@@ -107,7 +107,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// Select the line element
|
|
110
|
-
var lineSelectResult = Layer.selectElement(state, layerID, 'lines', lineID);
|
|
110
|
+
var lineSelectResult = _export.Layer.selectElement(state, layerID, 'lines', lineID);
|
|
111
111
|
if (lineSelectResult !== null && lineSelectResult !== void 0 && lineSelectResult.updatedState) {
|
|
112
112
|
state = lineSelectResult.updatedState;
|
|
113
113
|
}
|
|
@@ -115,7 +115,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
115
115
|
// Select the first vertex (if available)
|
|
116
116
|
var firstVertex = (_line$vertices = line.vertices) === null || _line$vertices === void 0 || (_line$vertices$get = _line$vertices.get) === null || _line$vertices$get === void 0 ? void 0 : _line$vertices$get.call(_line$vertices, 0);
|
|
117
117
|
if (firstVertex !== undefined) {
|
|
118
|
-
var v1Result = Layer.selectElement(state, layerID, 'vertices', firstVertex);
|
|
118
|
+
var v1Result = _export.Layer.selectElement(state, layerID, 'vertices', firstVertex);
|
|
119
119
|
if (v1Result !== null && v1Result !== void 0 && v1Result.updatedState) {
|
|
120
120
|
state = v1Result.updatedState;
|
|
121
121
|
}
|
|
@@ -124,7 +124,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
124
124
|
// Select the second vertex (if available)
|
|
125
125
|
var secondVertex = (_line$vertices2 = line.vertices) === null || _line$vertices2 === void 0 || (_line$vertices2$get = _line$vertices2.get) === null || _line$vertices2$get === void 0 ? void 0 : _line$vertices2$get.call(_line$vertices2, 1);
|
|
126
126
|
if (secondVertex !== undefined) {
|
|
127
|
-
var v2Result = Layer.selectElement(state, layerID, 'vertices', secondVertex);
|
|
127
|
+
var v2Result = _export.Layer.selectElement(state, layerID, 'vertices', secondVertex);
|
|
128
128
|
if (v2Result !== null && v2Result !== void 0 && v2Result.updatedState) {
|
|
129
129
|
state = v2Result.updatedState;
|
|
130
130
|
}
|
|
@@ -140,14 +140,14 @@ var Line = /*#__PURE__*/function () {
|
|
|
140
140
|
if (line) {
|
|
141
141
|
state = this.unselect(state, layerID, lineID).updatedState;
|
|
142
142
|
line.holes.forEach(function (holeID) {
|
|
143
|
-
return state = Hole.remove(state, layerID, holeID).updatedState;
|
|
143
|
+
return state = _export.Hole.remove(state, layerID, holeID).updatedState;
|
|
144
144
|
});
|
|
145
|
-
state = Layer.removeElement(state, layerID, 'lines', lineID).updatedState;
|
|
145
|
+
state = _export.Layer.removeElement(state, layerID, 'lines', lineID).updatedState;
|
|
146
146
|
line.vertices.forEach(function (vertexID) {
|
|
147
|
-
return state = Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
|
|
147
|
+
return state = _export.Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
|
|
148
148
|
});
|
|
149
149
|
state.getIn(['scene', 'groups']).forEach(function (group) {
|
|
150
|
-
return state = Group.removeElement(state, group.id, layerID, 'lines', lineID).updatedState;
|
|
150
|
+
return state = _export.Group.removeElement(state, group.id, layerID, 'lines', lineID).updatedState;
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
return {
|
|
@@ -177,9 +177,9 @@ var Line = /*#__PURE__*/function () {
|
|
|
177
177
|
value: function unselect(state, layerID, lineID) {
|
|
178
178
|
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
179
179
|
if (line) {
|
|
180
|
-
state = Layer.unselect(state, layerID, 'vertices', line.vertices.get(0)).updatedState;
|
|
181
|
-
state = Layer.unselect(state, layerID, 'vertices', line.vertices.get(1)).updatedState;
|
|
182
|
-
state = Layer.unselect(state, layerID, 'lines', lineID).updatedState;
|
|
180
|
+
state = _export.Layer.unselect(state, layerID, 'vertices', line.vertices.get(0)).updatedState;
|
|
181
|
+
state = _export.Layer.unselect(state, layerID, 'vertices', line.vertices.get(1)).updatedState;
|
|
182
|
+
state = _export.Layer.unselect(state, layerID, 'lines', lineID).updatedState;
|
|
183
183
|
}
|
|
184
184
|
return {
|
|
185
185
|
updatedState: state
|
|
@@ -202,8 +202,8 @@ var Line = /*#__PURE__*/function () {
|
|
|
202
202
|
stateL2 = _Line$create2.updatedState,
|
|
203
203
|
line1 = _Line$create2.line;
|
|
204
204
|
state = stateL2;
|
|
205
|
-
var splitPointOffset = GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, x, y);
|
|
206
|
-
var minVertex = GeometryUtils.minVertex(v0, v1);
|
|
205
|
+
var splitPointOffset = _export2.GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, x, y);
|
|
206
|
+
var minVertex = _export2.GeometryUtils.minVertex(v0, v1);
|
|
207
207
|
line.holes.forEach(function (holeID) {
|
|
208
208
|
var hole = state.getIn(['scene', 'layers', layerID, 'holes', holeID]);
|
|
209
209
|
var holeOffset = hole.offset;
|
|
@@ -218,7 +218,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
218
218
|
offset = 1 - offset;
|
|
219
219
|
}
|
|
220
220
|
*/
|
|
221
|
-
state = Hole.create(state, layerID, hole.type, line0.id, offset, hole.properties).updatedState;
|
|
221
|
+
state = _export.Hole.create(state, layerID, hole.type, line0.id, offset, hole.properties).updatedState;
|
|
222
222
|
} else {
|
|
223
223
|
var _offset = (holeOffset - splitPointOffset) / (1 - splitPointOffset);
|
|
224
224
|
/*
|
|
@@ -226,7 +226,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
226
226
|
offset = 1 - offset;
|
|
227
227
|
}
|
|
228
228
|
*/
|
|
229
|
-
state = Hole.create(state, layerID, hole.type, line1.id, _offset, hole.properties).updatedState;
|
|
229
|
+
state = _export.Hole.create(state, layerID, hole.type, line1.id, _offset, hole.properties).updatedState;
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
|
|
@@ -236,13 +236,13 @@ var Line = /*#__PURE__*/function () {
|
|
|
236
236
|
return lines && lines.contains(lineID);
|
|
237
237
|
});
|
|
238
238
|
lineGroups.forEach(function (group) {
|
|
239
|
-
state = Group.addElement(state, group.id, layerID, 'lines', line0.id).updatedState;
|
|
240
|
-
state = Group.addElement(state, group.id, layerID, 'lines', line1.id).updatedState;
|
|
239
|
+
state = _export.Group.addElement(state, group.id, layerID, 'lines', line0.id).updatedState;
|
|
240
|
+
state = _export.Group.addElement(state, group.id, layerID, 'lines', line1.id).updatedState;
|
|
241
241
|
});
|
|
242
242
|
state = Line.remove(state, layerID, lineID).updatedState;
|
|
243
243
|
return {
|
|
244
244
|
updatedState: state,
|
|
245
|
-
lines: new List([line0, line1])
|
|
245
|
+
lines: new _immutable.List([line0, line1])
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
}, {
|
|
@@ -250,7 +250,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
250
250
|
value: function addFromPoints(state, layerID, type, points, properties, holes) {
|
|
251
251
|
var _this = this;
|
|
252
252
|
var lineCreatedDateTime = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new Date().getTime();
|
|
253
|
-
points = new List(points).sort(function (_ref, _ref2) {
|
|
253
|
+
points = new _immutable.List(points).sort(function (_ref, _ref2) {
|
|
254
254
|
var x1 = _ref.x,
|
|
255
255
|
y1 = _ref.y;
|
|
256
256
|
var x2 = _ref2.x,
|
|
@@ -258,7 +258,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
258
258
|
return x1 === x2 ? y1 - y2 : x1 - x2;
|
|
259
259
|
});
|
|
260
260
|
var pointsPair = points.zip(points.skip(1)).filterNot(function (_ref3) {
|
|
261
|
-
var _ref4 =
|
|
261
|
+
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
262
262
|
_ref4$ = _ref4[0],
|
|
263
263
|
x1 = _ref4$.x,
|
|
264
264
|
y1 = _ref4$.y,
|
|
@@ -269,7 +269,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
269
269
|
});
|
|
270
270
|
var lines = [];
|
|
271
271
|
pointsPair.forEach(function (_ref5) {
|
|
272
|
-
var _ref6 =
|
|
272
|
+
var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
|
|
273
273
|
_ref6$ = _ref6[0],
|
|
274
274
|
x1 = _ref6$.x,
|
|
275
275
|
y1 = _ref6$.y,
|
|
@@ -280,10 +280,10 @@ var Line = /*#__PURE__*/function () {
|
|
|
280
280
|
stateL = _this$create.updatedState,
|
|
281
281
|
line = _this$create.line;
|
|
282
282
|
state = stateL;
|
|
283
|
-
var lineLength = GeometryUtils.pointsDistance(x1, y1, x2, y2);
|
|
284
|
-
var alpha = GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
|
|
285
|
-
var cosAlpha = GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
|
|
286
|
-
var sinAlpha = GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
|
|
283
|
+
var lineLength = _export2.GeometryUtils.pointsDistance(x1, y1, x2, y2);
|
|
284
|
+
var alpha = _export2.GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
|
|
285
|
+
var cosAlpha = _export2.GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
|
|
286
|
+
var sinAlpha = _export2.GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
|
|
287
287
|
if (holes) {
|
|
288
288
|
holes.forEach(function (holeWithOffsetPoint) {
|
|
289
289
|
var offset = holeWithOffsetPoint.hole.toJS().offset;
|
|
@@ -291,16 +291,16 @@ var Line = /*#__PURE__*/function () {
|
|
|
291
291
|
var _holeWithOffsetPoint$ = holeWithOffsetPoint.offsetPosition,
|
|
292
292
|
xp = _holeWithOffsetPoint$.x,
|
|
293
293
|
yp = _holeWithOffsetPoint$.y;
|
|
294
|
-
if (GeometryUtils.isPointOnLineSegment(x1, y1, x2, y2, xp, yp)) {
|
|
295
|
-
var newOffset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, xp, yp);
|
|
294
|
+
if (_export2.GeometryUtils.isPointOnLineSegment(x1, y1, x2, y2, xp, yp)) {
|
|
295
|
+
var newOffset = _export2.GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, xp, yp);
|
|
296
296
|
if (newOffset >= 0 && newOffset <= 1) {
|
|
297
297
|
//add the position of hole
|
|
298
|
-
var temp = Hole.create(state, layerID, holeWithOffsetPoint.hole.type, line.id, newOffset, holeWithOffsetPoint.hole.properties, xp, yp);
|
|
298
|
+
var temp = _export.Hole.create(state, layerID, holeWithOffsetPoint.hole.type, line.id, newOffset, holeWithOffsetPoint.hole.properties, xp, yp);
|
|
299
299
|
state = temp.updatedState;
|
|
300
300
|
var holeX = 0,
|
|
301
301
|
holeY = 0,
|
|
302
302
|
holeID = temp.hole.id;
|
|
303
|
-
if (GeometryUtils.almostEqual(y1, y2)) {
|
|
303
|
+
if (_export2.GeometryUtils.almostEqual(y1, y2)) {
|
|
304
304
|
if (x1 > x2) {
|
|
305
305
|
holeX = x1 - lineLength * newOffset;
|
|
306
306
|
holeY = y1;
|
|
@@ -308,7 +308,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
308
308
|
holeX = x1 + lineLength * newOffset;
|
|
309
309
|
holeY = y1;
|
|
310
310
|
}
|
|
311
|
-
} else if (GeometryUtils.almostEqual(x1, x2)) {
|
|
311
|
+
} else if (_export2.GeometryUtils.almostEqual(x1, x2)) {
|
|
312
312
|
if (y1 > y2) {
|
|
313
313
|
holeX = x1;
|
|
314
314
|
holeY = y1 - lineLength * newOffset;
|
|
@@ -343,7 +343,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
343
343
|
});
|
|
344
344
|
return {
|
|
345
345
|
updatedState: state,
|
|
346
|
-
lines: new List(lines),
|
|
346
|
+
lines: new _immutable.List(lines),
|
|
347
347
|
newline: lines[0]
|
|
348
348
|
};
|
|
349
349
|
}
|
|
@@ -363,21 +363,21 @@ var Line = /*#__PURE__*/function () {
|
|
|
363
363
|
var _line$vertices$map$to = line.vertices.map(function (vertexID) {
|
|
364
364
|
return reducedState.getIn(['scene', 'layers', layerID, 'vertices']).get(vertexID);
|
|
365
365
|
}).toArray(),
|
|
366
|
-
_line$vertices$map$to2 =
|
|
366
|
+
_line$vertices$map$to2 = (0, _slicedToArray2["default"])(_line$vertices$map$to, 2),
|
|
367
367
|
v0 = _line$vertices$map$to2[0],
|
|
368
368
|
v1 = _line$vertices$map$to2[1];
|
|
369
|
-
var hasCommonEndpoint = GeometryUtils.samePoints(v0, points[0]) || GeometryUtils.samePoints(v0, points[1]) || GeometryUtils.samePoints(v1, points[0]) || GeometryUtils.samePoints(v1, points[1]);
|
|
370
|
-
var intersection = GeometryUtils.twoLineSegmentsIntersection(points[0], points[1], v0, v1);
|
|
369
|
+
var hasCommonEndpoint = _export2.GeometryUtils.samePoints(v0, points[0]) || _export2.GeometryUtils.samePoints(v0, points[1]) || _export2.GeometryUtils.samePoints(v1, points[0]) || _export2.GeometryUtils.samePoints(v1, points[1]);
|
|
370
|
+
var intersection = _export2.GeometryUtils.twoLineSegmentsIntersection(points[0], points[1], v0, v1);
|
|
371
371
|
if (intersection.type === 'colinear') {
|
|
372
372
|
if (!oldHoles) {
|
|
373
373
|
oldHoles = [];
|
|
374
374
|
}
|
|
375
|
-
var orderedVertices = GeometryUtils.orderVertices(points);
|
|
375
|
+
var orderedVertices = _export2.GeometryUtils.orderVertices(points);
|
|
376
376
|
reducedState.getIn(['scene', 'layers', layerID, 'lines', line.id, 'holes']).forEach(function (holeID) {
|
|
377
377
|
var hole = reducedState.getIn(['scene', 'layers', layerID, 'holes', holeID]);
|
|
378
|
-
var oldLineLength = GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
|
|
379
|
-
var offset = GeometryUtils.samePoints(orderedVertices[1], line.vertices.get(1)) ? 1 - hole.offset : hole.offset;
|
|
380
|
-
var offsetPosition = GeometryUtils.extendLine(v0.x, v0.y, v1.x, v1.y, oldLineLength * offset);
|
|
378
|
+
var oldLineLength = _export2.GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
|
|
379
|
+
var offset = _export2.GeometryUtils.samePoints(orderedVertices[1], line.vertices.get(1)) ? 1 - hole.offset : hole.offset;
|
|
380
|
+
var offsetPosition = _export2.GeometryUtils.extendLine(v0.x, v0.y, v1.x, v1.y, oldLineLength * offset);
|
|
381
381
|
oldHoles.push({
|
|
382
382
|
hole: hole,
|
|
383
383
|
offsetPosition: offsetPosition
|
|
@@ -406,8 +406,8 @@ var Line = /*#__PURE__*/function () {
|
|
|
406
406
|
key: "replaceVertex",
|
|
407
407
|
value: function replaceVertex(state, layerID, lineID, vertexIndex, x, y) {
|
|
408
408
|
var vertexID = state.getIn(['scene', 'layers', layerID, 'lines', lineID, 'vertices', vertexIndex]);
|
|
409
|
-
state = Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
|
|
410
|
-
var _Vertex$add3 = Vertex.add(state, layerID, x, y, 'lines', lineID),
|
|
409
|
+
state = _export.Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
|
|
410
|
+
var _Vertex$add3 = _export.Vertex.add(state, layerID, x, y, 'lines', lineID),
|
|
411
411
|
stateV = _Vertex$add3.updatedState,
|
|
412
412
|
vertex = _Vertex$add3.vertex;
|
|
413
413
|
state = stateV;
|
|
@@ -423,8 +423,8 @@ var Line = /*#__PURE__*/function () {
|
|
|
423
423
|
key: "selectToolDrawingLine",
|
|
424
424
|
value: function selectToolDrawingLine(state, sceneComponentType) {
|
|
425
425
|
state = state.merge({
|
|
426
|
-
mode: MODE_WAITING_DRAWING_LINE,
|
|
427
|
-
drawingSupport: new Map({
|
|
426
|
+
mode: _constants.MODE_WAITING_DRAWING_LINE,
|
|
427
|
+
drawingSupport: new _immutable.Map({
|
|
428
428
|
type: sceneComponentType
|
|
429
429
|
})
|
|
430
430
|
});
|
|
@@ -436,16 +436,16 @@ var Line = /*#__PURE__*/function () {
|
|
|
436
436
|
key: "beginDrawingLine",
|
|
437
437
|
value: function beginDrawingLine(state, layerID, x, y) {
|
|
438
438
|
// if end drawing by created area
|
|
439
|
-
if (state.mode == MODE_IDLE) {
|
|
439
|
+
if (state.mode == _constants.MODE_IDLE) {
|
|
440
440
|
return {
|
|
441
441
|
updatedState: state
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
444
|
// ///////////////
|
|
445
|
-
var snapElements = SnapSceneUtils.sceneSnapElements(state.scene, new List(), state.snapMask);
|
|
445
|
+
var snapElements = _export2.SnapSceneUtils.sceneSnapElements(state.scene, new _immutable.List(), state.snapMask);
|
|
446
446
|
var snap = null;
|
|
447
447
|
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
448
|
-
snap = SnapUtils.nearestSnap(snapElements, x, y, state.snapMask);
|
|
448
|
+
snap = _export2.SnapUtils.nearestSnap(snapElements, x, y, state.snapMask);
|
|
449
449
|
if (snap) {
|
|
450
450
|
var _snap$point = snap.point;
|
|
451
451
|
x = _snap$point.x;
|
|
@@ -453,36 +453,36 @@ var Line = /*#__PURE__*/function () {
|
|
|
453
453
|
}
|
|
454
454
|
snapElements = snapElements.withMutations(function (snapElements) {
|
|
455
455
|
var a, b, c;
|
|
456
|
-
var _GeometryUtils$horizo = GeometryUtils.horizontalLine(y);
|
|
456
|
+
var _GeometryUtils$horizo = _export2.GeometryUtils.horizontalLine(y);
|
|
457
457
|
a = _GeometryUtils$horizo.a;
|
|
458
458
|
b = _GeometryUtils$horizo.b;
|
|
459
459
|
c = _GeometryUtils$horizo.c;
|
|
460
|
-
SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
461
|
-
var _GeometryUtils$vertic = GeometryUtils.verticalLine(x);
|
|
460
|
+
_export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
461
|
+
var _GeometryUtils$vertic = _export2.GeometryUtils.verticalLine(x);
|
|
462
462
|
a = _GeometryUtils$vertic.a;
|
|
463
463
|
b = _GeometryUtils$vertic.b;
|
|
464
464
|
c = _GeometryUtils$vertic.c;
|
|
465
|
-
SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
466
|
-
var _GeometryUtils$upcros = GeometryUtils.upcrossLine(x, y);
|
|
465
|
+
_export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
466
|
+
var _GeometryUtils$upcros = _export2.GeometryUtils.upcrossLine(x, y);
|
|
467
467
|
a = _GeometryUtils$upcros.a;
|
|
468
468
|
b = _GeometryUtils$upcros.b;
|
|
469
469
|
c = _GeometryUtils$upcros.c;
|
|
470
|
-
SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
471
|
-
var _GeometryUtils$downcr = GeometryUtils.downcrossLine(x, y);
|
|
470
|
+
_export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
471
|
+
var _GeometryUtils$downcr = _export2.GeometryUtils.downcrossLine(x, y);
|
|
472
472
|
a = _GeometryUtils$downcr.a;
|
|
473
473
|
b = _GeometryUtils$downcr.b;
|
|
474
474
|
c = _GeometryUtils$downcr.c;
|
|
475
|
-
SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
475
|
+
_export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
478
|
var drawingSupport = state.get('drawingSupport').set('layerID', layerID);
|
|
479
|
-
state = Layer.unselectAll(state, layerID).updatedState;
|
|
479
|
+
state = _export.Layer.unselectAll(state, layerID).updatedState;
|
|
480
480
|
var _Line$create3 = Line.create(state, layerID, drawingSupport.get('type'), x, y, x, y),
|
|
481
481
|
stateL = _Line$create3.updatedState,
|
|
482
482
|
line = _Line$create3.line;
|
|
483
483
|
state = Line.select(stateL, layerID, line.id).updatedState;
|
|
484
484
|
state = state.merge({
|
|
485
|
-
mode: MODE_DRAWING_LINE,
|
|
485
|
+
mode: _constants.MODE_DRAWING_LINE,
|
|
486
486
|
snapElements: snapElements,
|
|
487
487
|
activeSnapElement: snap ? snap.snap : null,
|
|
488
488
|
drawingSupport: drawingSupport
|
|
@@ -496,7 +496,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
496
496
|
value: function updateDrawingLine(state, x, y, relatedLines) {
|
|
497
497
|
var snap = null;
|
|
498
498
|
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
499
|
-
snap = SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
|
|
499
|
+
snap = _export2.SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
|
|
500
500
|
if (snap) {
|
|
501
501
|
var _snap$point2 = snap.point;
|
|
502
502
|
x = _snap$point2.x;
|
|
@@ -512,7 +512,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
512
512
|
var moveFlag = true;
|
|
513
513
|
var tx = vertices[drawingLine.vertices[1]].x;
|
|
514
514
|
var ty = vertices[drawingLine.vertices[1]].y;
|
|
515
|
-
if (!isEmpty(relatedLines)) {
|
|
515
|
+
if (!(0, _helper.isEmpty)(relatedLines)) {
|
|
516
516
|
vertices[drawingLine.vertices[1]].x = x;
|
|
517
517
|
vertices[drawingLine.vertices[1]].y = y;
|
|
518
518
|
}
|
|
@@ -522,12 +522,12 @@ var Line = /*#__PURE__*/function () {
|
|
|
522
522
|
if (drawingLine.vertices[0] !== drawingLine.vertices[1]) {
|
|
523
523
|
relatedLines.forEach(function (line) {
|
|
524
524
|
// get the points of two lines(drawing line and related line)
|
|
525
|
-
if (!isEmpty(line)) {
|
|
525
|
+
if (!(0, _helper.isEmpty)(line)) {
|
|
526
526
|
// the angle between two lines(line, drawingLine)
|
|
527
|
-
lineAngle = GeometryUtils.angleBetweenTwoLines(line, drawingLine, vertices);
|
|
527
|
+
lineAngle = _export2.GeometryUtils.angleBetweenTwoLines(line, drawingLine, vertices);
|
|
528
528
|
// check whether the angle is less than or bigger than specific value.
|
|
529
529
|
absAngle = Math.abs(lineAngle);
|
|
530
|
-
if (absAngle < MIN_ANGLE_DISALLOW_DRAW_WALL || absAngle > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
530
|
+
if (absAngle < _constants.MIN_ANGLE_DISALLOW_DRAW_WALL || absAngle > 360 - _constants.MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
531
531
|
moveFlag = false;
|
|
532
532
|
} else moveFlag = true;
|
|
533
533
|
}
|
|
@@ -539,20 +539,20 @@ var Line = /*#__PURE__*/function () {
|
|
|
539
539
|
tx = x;
|
|
540
540
|
ty = y;
|
|
541
541
|
} else {
|
|
542
|
-
var rest = MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
|
|
542
|
+
var rest = _constants.MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
|
|
543
543
|
// the origin point of rotation(snapping)
|
|
544
544
|
var ox = vertices[drawingLine.vertices[0]].x;
|
|
545
545
|
var oy = vertices[drawingLine.vertices[0]].y;
|
|
546
546
|
// determine the direction of rotation.
|
|
547
547
|
rest = lineAngle > 0 ? -rest : rest;
|
|
548
548
|
// rotate the current point to last point around the first point of drawing line.
|
|
549
|
-
var res = GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
|
|
549
|
+
var res = _export2.GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
|
|
550
550
|
tx = res.x;
|
|
551
551
|
ty = res.y;
|
|
552
552
|
}
|
|
553
553
|
// angle snapping as a value of UNIT_ANGLE
|
|
554
|
-
if (moveFlag && !isEmpty(absAngle) && absAngle % UNIT_ANGLE !== 0) {
|
|
555
|
-
var result = GeometryUtils.snapAngleByUnit(lineAngle, vertices, drawingLine, tx, ty, drawingLine.vertices[1]);
|
|
554
|
+
if (moveFlag && !(0, _helper.isEmpty)(absAngle) && absAngle % _constants.UNIT_ANGLE !== 0) {
|
|
555
|
+
var result = _export2.GeometryUtils.snapAngleByUnit(lineAngle, vertices, drawingLine, tx, ty, drawingLine.vertices[1]);
|
|
556
556
|
tx = result.x;
|
|
557
557
|
ty = result.y;
|
|
558
558
|
}
|
|
@@ -582,9 +582,9 @@ var Line = /*#__PURE__*/function () {
|
|
|
582
582
|
var _layer$lines$get;
|
|
583
583
|
var holeOffset = [];
|
|
584
584
|
(_layer$lines$get = layer.lines.get(lineID)) === null || _layer$lines$get === void 0 || _layer$lines$get.holes.forEach(function (holeID) {
|
|
585
|
-
var lineLength = GeometryUtils.pointsDistance(nv0.x, nv0.y, nv1.x, nv1.y);
|
|
586
|
-
var minV = GeometryUtils.minVertex(nv0, nv1);
|
|
587
|
-
var maxV = GeometryUtils.maxVertex(nv0, nv1);
|
|
585
|
+
var lineLength = _export2.GeometryUtils.pointsDistance(nv0.x, nv0.y, nv1.x, nv1.y);
|
|
586
|
+
var minV = _export2.GeometryUtils.minVertex(nv0, nv1);
|
|
587
|
+
var maxV = _export2.GeometryUtils.maxVertex(nv0, nv1);
|
|
588
588
|
var alpha = Math.atan2(maxV.y - minV.y, maxV.x - minV.x);
|
|
589
589
|
var hole = layer.holes.get(holeID);
|
|
590
590
|
var pointOnLine = lineLength * hole.offset;
|
|
@@ -625,7 +625,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
625
625
|
return mgline.id === lineID;
|
|
626
626
|
});
|
|
627
627
|
});
|
|
628
|
-
if (!isEmpty(relatedLineID)) {
|
|
628
|
+
if (!(0, _helper.isEmpty)(relatedLineID)) {
|
|
629
629
|
var relatedLine = layer.lines.get(relatedLineID[0]);
|
|
630
630
|
var intersectionPoint = vertex;
|
|
631
631
|
var startPoint, endPoint;
|
|
@@ -642,8 +642,8 @@ var Line = /*#__PURE__*/function () {
|
|
|
642
642
|
var tline2 = {
|
|
643
643
|
vertices: [intersectionPoint.id, endPoint.id]
|
|
644
644
|
};
|
|
645
|
-
var angle = Math.abs(GeometryUtils.angleBetweenTwoLines(tline1, tline2, allVertices.toJS()));
|
|
646
|
-
if (Math.abs(angle - 180) <= EPSILON) {
|
|
645
|
+
var angle = Math.abs(_export2.GeometryUtils.angleBetweenTwoLines(tline1, tline2, allVertices.toJS()));
|
|
646
|
+
if (Math.abs(angle - 180) <= _constants.EPSILON) {
|
|
647
647
|
selectedLineInfo.mergelines.push(relatedLine);
|
|
648
648
|
selectedLineInfo.points[0] = startPoint;
|
|
649
649
|
selectedLineInfo.points[1] = endPoint;
|
|
@@ -661,7 +661,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
661
661
|
var allVertices = state.getIn(['scene', 'layers', layerID, 'vertices']);
|
|
662
662
|
var lineID = state.getIn(['scene', 'layers', layerID, 'selected', 'lines']).first();
|
|
663
663
|
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
664
|
-
if (isEmpty(line)) {
|
|
664
|
+
if ((0, _helper.isEmpty)(line)) {
|
|
665
665
|
return {
|
|
666
666
|
updatedState: state
|
|
667
667
|
};
|
|
@@ -693,13 +693,13 @@ var Line = /*#__PURE__*/function () {
|
|
|
693
693
|
var holesWithOffsetPosition = [];
|
|
694
694
|
var lineID = layer.getIn(['selected', 'lines']).first(); // lines : [id]
|
|
695
695
|
var line = layer.getIn(['lines', lineID]);
|
|
696
|
-
if (isEmpty(line)) {
|
|
696
|
+
if ((0, _helper.isEmpty)(line)) {
|
|
697
697
|
return {
|
|
698
698
|
updatedState: state
|
|
699
699
|
};
|
|
700
700
|
}
|
|
701
701
|
mergeInfo.mergelines.forEach(function (line) {
|
|
702
|
-
if ([END_DRAGGING_LINE, END_DRAGGING_VERTEX].includes(actionType)) {
|
|
702
|
+
if ([_constants.END_DRAGGING_LINE, _constants.END_DRAGGING_VERTEX].includes(actionType)) {
|
|
703
703
|
var tmpGroups = state //get groups membership if present
|
|
704
704
|
.getIn(['scene', 'groups']).filter(function (group) {
|
|
705
705
|
var lines = group.getIn(['elements', layerID, 'lines']);
|
|
@@ -718,20 +718,20 @@ var Line = /*#__PURE__*/function () {
|
|
|
718
718
|
state = Line.remove(state, layerID, line.id).updatedState;
|
|
719
719
|
});
|
|
720
720
|
var ret;
|
|
721
|
-
if (!GeometryUtils.samePoints(mergeInfo.points[0], mergeInfo.points[1])) {
|
|
721
|
+
if (!_export2.GeometryUtils.samePoints(mergeInfo.points[0], mergeInfo.points[1])) {
|
|
722
722
|
ret = Line.createAvoidingIntersections(state, layerID, line.type, mergeInfo.points[0].x, mergeInfo.points[0].y, mergeInfo.points[1].x, mergeInfo.points[1].y, line.properties, holesWithOffsetPosition, line.createdDateTime);
|
|
723
723
|
state = ret.updatedState;
|
|
724
724
|
}
|
|
725
|
-
if ([END_DRAGGING_LINE, END_DRAGGING_VERTEX].includes(actionType)) {
|
|
725
|
+
if ([_constants.END_DRAGGING_LINE, _constants.END_DRAGGING_VERTEX].includes(actionType)) {
|
|
726
726
|
//re-add to old line's groups if present
|
|
727
727
|
ret.lines.forEach(function (addedLine) {
|
|
728
728
|
lineGroups.forEach(function (oldLineGroup) {
|
|
729
|
-
state = Group.addElement(state, oldLineGroup.id, layerID, 'lines', addedLine.id).updatedState;
|
|
729
|
+
state = _export.Group.addElement(state, oldLineGroup.id, layerID, 'lines', addedLine.id).updatedState;
|
|
730
730
|
});
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
state = Layer.removeZeroLengthLines(state, layerID).updatedState;
|
|
734
|
-
if (!isEmpty((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.newline)) {
|
|
733
|
+
state = _export.Layer.removeZeroLengthLines(state, layerID).updatedState;
|
|
734
|
+
if (!(0, _helper.isEmpty)((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.newline)) {
|
|
735
735
|
state = this.select(state, layerID, ret.newline.get('id')).updatedState;
|
|
736
736
|
}
|
|
737
737
|
return {
|
|
@@ -746,10 +746,10 @@ var Line = /*#__PURE__*/function () {
|
|
|
746
746
|
var lineID = layer.getIn(['selected', 'lines']).first(); // lines : [id]
|
|
747
747
|
var line = layer.getIn(['lines', lineID]);
|
|
748
748
|
var drawingInfo = {};
|
|
749
|
-
if (!isEmpty(line)) {
|
|
749
|
+
if (!(0, _helper.isEmpty)(line)) {
|
|
750
750
|
drawingInfo.drawingLine = line;
|
|
751
751
|
}
|
|
752
|
-
state = Layer.detectAndUpdateAreas(state, layerID, drawingInfo).updatedState;
|
|
752
|
+
state = _export.Layer.detectAndUpdateAreas(state, layerID, drawingInfo).updatedState;
|
|
753
753
|
return {
|
|
754
754
|
updatedState: state
|
|
755
755
|
};
|
|
@@ -771,16 +771,16 @@ var Line = /*#__PURE__*/function () {
|
|
|
771
771
|
var layerID = state.getIn(['scene', 'selectedLayer']);
|
|
772
772
|
var lineID = state.getIn(['scene', 'layers', layerID, 'selected', 'lines']).first();
|
|
773
773
|
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
774
|
-
if (isEmpty(line)) {
|
|
774
|
+
if ((0, _helper.isEmpty)(line)) {
|
|
775
775
|
return {
|
|
776
776
|
updatedState: state
|
|
777
777
|
};
|
|
778
778
|
}
|
|
779
|
-
if (!isEmpty(v0)) {
|
|
779
|
+
if (!(0, _helper.isEmpty)(v0)) {
|
|
780
780
|
state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(0), 'x'], v0.x);
|
|
781
781
|
state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(0), 'y'], v0.y);
|
|
782
782
|
}
|
|
783
|
-
if (!isEmpty(v1)) {
|
|
783
|
+
if (!(0, _helper.isEmpty)(v1)) {
|
|
784
784
|
state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(1), 'x'], v1.x);
|
|
785
785
|
state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(1), 'y'], v1.y);
|
|
786
786
|
}
|
|
@@ -794,7 +794,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
794
794
|
key: "endDrawingLine",
|
|
795
795
|
value: function endDrawingLine(state, x, y) {
|
|
796
796
|
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
797
|
-
var snap = SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
|
|
797
|
+
var snap = _export2.SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
|
|
798
798
|
if (snap) {
|
|
799
799
|
var _snap$point3 = snap.point;
|
|
800
800
|
x = _snap$point3.x;
|
|
@@ -807,8 +807,8 @@ var Line = /*#__PURE__*/function () {
|
|
|
807
807
|
if (drawingLine.vertices[0] === drawingLine.vertices[1]) {
|
|
808
808
|
state = Line.remove(state, layerID, lineID).updatedState;
|
|
809
809
|
state = state.merge({
|
|
810
|
-
mode: MODE_IDLE,
|
|
811
|
-
snapElements: new List(),
|
|
810
|
+
mode: _constants.MODE_IDLE,
|
|
811
|
+
snapElements: new _immutable.List(),
|
|
812
812
|
activeSnapElement: null
|
|
813
813
|
});
|
|
814
814
|
return {
|
|
@@ -819,10 +819,10 @@ var Line = /*#__PURE__*/function () {
|
|
|
819
819
|
x: x,
|
|
820
820
|
y: y
|
|
821
821
|
}, state).updatedState;
|
|
822
|
-
state = this.applyWallChanges(state, END_DRAWING_LINE).updatedState;
|
|
822
|
+
state = this.applyWallChanges(state, _constants.END_DRAWING_LINE).updatedState;
|
|
823
823
|
state = state.merge({
|
|
824
|
-
mode: MODE_WAITING_DRAWING_LINE,
|
|
825
|
-
snapElements: new List(),
|
|
824
|
+
mode: _constants.MODE_WAITING_DRAWING_LINE,
|
|
825
|
+
snapElements: new _immutable.List(),
|
|
826
826
|
activeSnapElement: null
|
|
827
827
|
});
|
|
828
828
|
return {
|
|
@@ -832,15 +832,15 @@ var Line = /*#__PURE__*/function () {
|
|
|
832
832
|
}, {
|
|
833
833
|
key: "beginDraggingLine",
|
|
834
834
|
value: function beginDraggingLine(state, layerID, lineID, x, y) {
|
|
835
|
-
var snapElements = SnapSceneUtils.sceneSnapElements(state.scene, new List(), state.snapMask);
|
|
835
|
+
var snapElements = _export2.SnapSceneUtils.sceneSnapElements(state.scene, new _immutable.List(), state.snapMask);
|
|
836
836
|
var layer = state.scene.layers.get(layerID);
|
|
837
837
|
var line = layer.lines.get(lineID);
|
|
838
838
|
var vertex0 = layer.vertices.get(line.vertices.get(0));
|
|
839
839
|
var vertex1 = layer.vertices.get(line.vertices.get(1));
|
|
840
840
|
state = state.merge({
|
|
841
|
-
mode: MODE_DRAGGING_LINE,
|
|
841
|
+
mode: _constants.MODE_DRAGGING_LINE,
|
|
842
842
|
snapElements: snapElements,
|
|
843
|
-
draggingSupport: Map({
|
|
843
|
+
draggingSupport: (0, _immutable.Map)({
|
|
844
844
|
layerID: layerID,
|
|
845
845
|
lineID: lineID,
|
|
846
846
|
startPointX: x,
|
|
@@ -878,7 +878,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
878
878
|
var vec1 = pos1.clone().sub(cen).normalize();
|
|
879
879
|
var vec2 = pos2.clone().sub(cen).normalize();
|
|
880
880
|
var angle = Math.floor(vec1.angle() * 180 / Math.PI - vec2.angle() * 180 / Math.PI + 0.5);
|
|
881
|
-
if (Math.abs(angle) < MIN_ANGLE_DISALLOW_DRAW_WALL || Math.abs(angle) > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
881
|
+
if (Math.abs(angle) < _constants.MIN_ANGLE_DISALLOW_DRAW_WALL || Math.abs(angle) > 360 - _constants.MIN_ANGLE_DISALLOW_DRAW_WALL) {
|
|
882
882
|
mvFlag.push(false);
|
|
883
883
|
} else {
|
|
884
884
|
mvFlag.push(true);
|
|
@@ -918,8 +918,8 @@ var Line = /*#__PURE__*/function () {
|
|
|
918
918
|
var curSnap0 = null,
|
|
919
919
|
curSnap1 = null;
|
|
920
920
|
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
921
|
-
curSnap0 = SnapUtils.nearestSnap(snapElements, newVertex0X, newVertex0Y, state.snapMask);
|
|
922
|
-
curSnap1 = SnapUtils.nearestSnap(snapElements, newVertex1X, newVertex1Y, state.snapMask);
|
|
921
|
+
curSnap0 = _export2.SnapUtils.nearestSnap(snapElements, newVertex0X, newVertex0Y, state.snapMask);
|
|
922
|
+
curSnap1 = _export2.SnapUtils.nearestSnap(snapElements, newVertex1X, newVertex1Y, state.snapMask);
|
|
923
923
|
}
|
|
924
924
|
var deltaX = 0,
|
|
925
925
|
deltaY = 0;
|
|
@@ -1003,8 +1003,8 @@ var Line = /*#__PURE__*/function () {
|
|
|
1003
1003
|
var newVertex1X = draggingSupport.get('startVertex1X') + diffX;
|
|
1004
1004
|
var newVertex1Y = draggingSupport.get('startVertex1Y') + diffY;
|
|
1005
1005
|
if (state.snapMask && !state.snapMask.isEmpty()) {
|
|
1006
|
-
var curSnap0 = SnapUtils.nearestSnap(state.snapElements, newVertex0X, newVertex0Y, state.snapMask);
|
|
1007
|
-
var curSnap1 = SnapUtils.nearestSnap(state.snapElements, newVertex1X, newVertex1Y, state.snapMask);
|
|
1006
|
+
var curSnap0 = _export2.SnapUtils.nearestSnap(state.snapElements, newVertex0X, newVertex0Y, state.snapMask);
|
|
1007
|
+
var curSnap1 = _export2.SnapUtils.nearestSnap(state.snapElements, newVertex1X, newVertex1Y, state.snapMask);
|
|
1008
1008
|
var deltaX = 0,
|
|
1009
1009
|
deltaY = 0;
|
|
1010
1010
|
if (curSnap0 && curSnap1) {
|
|
@@ -1041,9 +1041,9 @@ var Line = /*#__PURE__*/function () {
|
|
|
1041
1041
|
newVertex0Y = newResult.newVertex0Y;
|
|
1042
1042
|
newVertex1X = newResult.newVertex1X;
|
|
1043
1043
|
newVertex1Y = newResult.newVertex1Y;
|
|
1044
|
-
state = Layer.mergeEqualsVertices(state, layerID, line.vertices.get(0)).updatedState;
|
|
1045
|
-
state = Layer.mergeEqualsVertices(state, layerID, line.vertices.get(1)).updatedState;
|
|
1046
|
-
if (GeometryUtils.samePoints({
|
|
1044
|
+
state = _export.Layer.mergeEqualsVertices(state, layerID, line.vertices.get(0)).updatedState;
|
|
1045
|
+
state = _export.Layer.mergeEqualsVertices(state, layerID, line.vertices.get(1)).updatedState;
|
|
1046
|
+
if (_export2.GeometryUtils.samePoints({
|
|
1047
1047
|
newVertex0X: newVertex0X,
|
|
1048
1048
|
newVertex0Y: newVertex0Y
|
|
1049
1049
|
}, {
|
|
@@ -1059,13 +1059,13 @@ var Line = /*#__PURE__*/function () {
|
|
|
1059
1059
|
x: newVertex1X,
|
|
1060
1060
|
y: newVertex1Y
|
|
1061
1061
|
}, state).updatedState;
|
|
1062
|
-
state = this.applyWallChanges(state, END_DRAGGING_LINE).updatedState;
|
|
1062
|
+
state = this.applyWallChanges(state, _constants.END_DRAGGING_LINE).updatedState;
|
|
1063
1063
|
}
|
|
1064
1064
|
state = state.merge({
|
|
1065
|
-
mode: MODE_IDLE,
|
|
1065
|
+
mode: _constants.MODE_IDLE,
|
|
1066
1066
|
draggingSupport: null,
|
|
1067
1067
|
activeSnapElement: null,
|
|
1068
|
-
snapElements: new List()
|
|
1068
|
+
snapElements: new _immutable.List()
|
|
1069
1069
|
});
|
|
1070
1070
|
return {
|
|
1071
1071
|
updatedState: state
|
|
@@ -1082,7 +1082,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
1082
1082
|
}, {
|
|
1083
1083
|
key: "setJsProperties",
|
|
1084
1084
|
value: function setJsProperties(state, layerID, lineID, properties) {
|
|
1085
|
-
return this.setProperties(state, layerID, lineID, fromJS(properties));
|
|
1085
|
+
return this.setProperties(state, layerID, lineID, (0, _immutable.fromJS)(properties));
|
|
1086
1086
|
}
|
|
1087
1087
|
}, {
|
|
1088
1088
|
key: "updateProperties",
|
|
@@ -1097,7 +1097,7 @@ var Line = /*#__PURE__*/function () {
|
|
|
1097
1097
|
}, {
|
|
1098
1098
|
key: "updateJsProperties",
|
|
1099
1099
|
value: function updateJsProperties(state, layerID, lineID, properties) {
|
|
1100
|
-
return this.updateProperties(state, layerID, lineID, fromJS(properties));
|
|
1100
|
+
return this.updateProperties(state, layerID, lineID, (0, _immutable.fromJS)(properties));
|
|
1101
1101
|
}
|
|
1102
1102
|
}, {
|
|
1103
1103
|
key: "setAttributes",
|
|
@@ -1116,17 +1116,17 @@ var Line = /*#__PURE__*/function () {
|
|
|
1116
1116
|
delete lAttr['lineToExtend'];
|
|
1117
1117
|
delete lAttr['lineLength'];
|
|
1118
1118
|
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
1119
|
-
state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineID], fromJS(lAttr)).mergeIn(['scene', 'layers', layerID, 'vertices', vertexOne.id], {
|
|
1119
|
+
state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineID], (0, _immutable.fromJS)(lAttr)).mergeIn(['scene', 'layers', layerID, 'vertices', vertexOne.id], {
|
|
1120
1120
|
x: vertexOne.x,
|
|
1121
1121
|
y: vertexOne.y
|
|
1122
1122
|
}).mergeIn(['scene', 'layers', layerID, 'vertices', vertexTwo.id], {
|
|
1123
1123
|
x: vertexTwo.x,
|
|
1124
1124
|
y: vertexTwo.y
|
|
1125
|
-
}).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'misc'], new Map({
|
|
1125
|
+
}).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'misc'], new _immutable.Map({
|
|
1126
1126
|
_unitLength: lineLength._unit
|
|
1127
1127
|
})).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'focus'], true);
|
|
1128
1128
|
if (lineToExtend) {
|
|
1129
|
-
state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id], fromJS(lAttr)).mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id, 'misc'], new Map({
|
|
1129
|
+
state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id], (0, _immutable.fromJS)(lAttr)).mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id, 'misc'], new _immutable.Map({
|
|
1130
1130
|
_unitLength: lineLength._unit
|
|
1131
1131
|
}));
|
|
1132
1132
|
}
|
|
@@ -1142,14 +1142,14 @@ var Line = /*#__PURE__*/function () {
|
|
|
1142
1142
|
y: vertexFour.y
|
|
1143
1143
|
});
|
|
1144
1144
|
}
|
|
1145
|
-
state = Layer.mergeEqualsVertices(state, layerID, vertexOne.id).updatedState;
|
|
1145
|
+
state = _export.Layer.mergeEqualsVertices(state, layerID, vertexOne.id).updatedState;
|
|
1146
1146
|
if (vertexOne.x != vertexTwo.x && vertexOne.y != vertexTwo.y) {
|
|
1147
|
-
state = Layer.mergeEqualsVertices(state, layerID, vertexTwo.id).updatedState;
|
|
1147
|
+
state = _export.Layer.mergeEqualsVertices(state, layerID, vertexTwo.id).updatedState;
|
|
1148
1148
|
}
|
|
1149
1149
|
state = this.select(state, layerID, lineID).updatedState;
|
|
1150
|
-
state = this.applyWallChanges(state, END_DRAWING_LINE).updatedState;
|
|
1150
|
+
state = this.applyWallChanges(state, _constants.END_DRAWING_LINE).updatedState;
|
|
1151
1151
|
state = state.merge({
|
|
1152
|
-
sceneHistory: history.historyPush(state.sceneHistory, state.scene)
|
|
1152
|
+
sceneHistory: _export2.history.historyPush(state.sceneHistory, state.scene)
|
|
1153
1153
|
});
|
|
1154
1154
|
if (state.mode.endsWith('_LINE')) {
|
|
1155
1155
|
state = state.setIn(['scene', 'setLineAttributes'], true);
|
|
@@ -1163,11 +1163,11 @@ var Line = /*#__PURE__*/function () {
|
|
|
1163
1163
|
key: "setVerticesCoords",
|
|
1164
1164
|
value: function setVerticesCoords(state, layerID, lineID, x1, y1, x2, y2) {
|
|
1165
1165
|
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
1166
|
-
state = Vertex.setAttributes(state, layerID, line.vertices.get(0), new Map({
|
|
1166
|
+
state = _export.Vertex.setAttributes(state, layerID, line.vertices.get(0), new _immutable.Map({
|
|
1167
1167
|
x: x1,
|
|
1168
1168
|
y: y1
|
|
1169
1169
|
})).updatedState;
|
|
1170
|
-
state = Vertex.setAttributes(state, layerID, line.vertices.get(1), new Map({
|
|
1170
|
+
state = _export.Vertex.setAttributes(state, layerID, line.vertices.get(1), new _immutable.Map({
|
|
1171
1171
|
x: x2,
|
|
1172
1172
|
y: y2
|
|
1173
1173
|
})).updatedState;
|
|
@@ -1176,5 +1176,4 @@ var Line = /*#__PURE__*/function () {
|
|
|
1176
1176
|
};
|
|
1177
1177
|
}
|
|
1178
1178
|
}]);
|
|
1179
|
-
}();
|
|
1180
|
-
export { Line as default };
|
|
1179
|
+
}();
|