@leafer-in/editor 1.5.2 → 1.6.0

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.
@@ -1,4 +1,4 @@
1
- import { Event, defineKey, MatrixHelper, BoundsHelper, LeafBoundsHelper, getMatrixData, getBoundsData, UI, Paint, Group, Rect, Bounds, LeafList, Direction9, AroundHelper, MathHelper, PointHelper, Box, Text, Matrix, Debug, LeafHelper, PropertyEvent, isNull, DataHelper, RenderEvent, getPointData, Plugin as Plugin$1, Creator, dataType } from '@leafer-ui/draw';
1
+ import { Event, defineKey, isNull, MatrixHelper, BoundsHelper, LeafBoundsHelper, getMatrixData, getBoundsData, UI, Paint, Group, Rect, Bounds, LeafList, Direction9, AroundHelper, MathHelper, PointHelper, Box, ResizeEvent, Text, Matrix, Debug, LeafHelper, PropertyEvent, DataHelper, RenderEvent, getPointData, Plugin as Plugin$1, Creator, dataType } from '@leafer-ui/draw';
2
2
  import { PointerEvent, DragEvent, MoveEvent, ZoomEvent, Plugin, RotateEvent, KeyEvent } from '@leafer-ui/core';
3
3
  import '@leafer-in/resize';
4
4
 
@@ -88,15 +88,52 @@ function targetAttr(fn) {
88
88
  set(value) {
89
89
  const old = this[privateKey];
90
90
  if (old !== value) {
91
- const type = key === 'target' ? EditorEvent.BEFORE_SELECT : EditorEvent.BEFORE_HOVER;
92
- if (this.hasEvent(type))
93
- this.emitEvent(new EditorEvent(type, { editor: this, value: value, oldValue: old }));
91
+ if (this.config) {
92
+ const isSelect = key === 'target';
93
+ if (isSelect) {
94
+ if (value instanceof Array && value.length > 1 && value[0].locked)
95
+ value.splice(0, 1);
96
+ const { beforeSelect } = this.config;
97
+ if (beforeSelect) {
98
+ const check = beforeSelect({ target: value });
99
+ if (typeof check === 'object')
100
+ value = check;
101
+ else if (check === false)
102
+ return;
103
+ }
104
+ }
105
+ const type = isSelect ? EditorEvent.BEFORE_SELECT : EditorEvent.BEFORE_HOVER;
106
+ if (this.hasEvent(type))
107
+ this.emitEvent(new EditorEvent(type, { editor: this, value: value, oldValue: old }));
108
+ }
94
109
  this[privateKey] = value, fn(this, old);
95
110
  }
96
111
  }
97
112
  });
98
113
  };
99
114
  }
115
+ function mergeConfigAttr() {
116
+ return (target, key) => {
117
+ defineKey(target, key, {
118
+ get() {
119
+ const { config, element, dragPoint } = this, mergeConfig = Object.assign({}, config);
120
+ if (element && element.editConfig)
121
+ Object.assign(mergeConfig, element.editConfig);
122
+ if (dragPoint) {
123
+ if (dragPoint.editConfig)
124
+ Object.assign(mergeConfig, dragPoint.editConfig);
125
+ if (mergeConfig.editSize === 'font-size')
126
+ mergeConfig.lockRatio = true;
127
+ if (dragPoint.pointType === 'resize-rotate') {
128
+ mergeConfig.around || (mergeConfig.around = 'center');
129
+ isNull(mergeConfig.lockRatio) && (mergeConfig.lockRatio = true);
130
+ }
131
+ }
132
+ return this.mergedConfig = mergeConfig;
133
+ }
134
+ });
135
+ };
136
+ }
100
137
 
101
138
  const { abs } = Math;
102
139
  const { copy: copy$1, scale } = MatrixHelper;
@@ -108,6 +145,7 @@ class Stroker extends UI {
108
145
  constructor() {
109
146
  super();
110
147
  this.list = [];
148
+ this.visible = 0;
111
149
  this.hittable = false;
112
150
  this.strokeAlign = 'center';
113
151
  }
@@ -121,10 +159,10 @@ class Stroker extends UI {
121
159
  if (list.length) {
122
160
  setListWithFn(bounds$1, list, worldBounds);
123
161
  this.set(bounds$1);
162
+ this.visible = true;
124
163
  }
125
- else {
126
- this.width = this.height = 1;
127
- }
164
+ else
165
+ this.visible = 0;
128
166
  }
129
167
  __draw(canvas, options) {
130
168
  const { list } = this;
@@ -136,8 +174,9 @@ class Stroker extends UI {
136
174
  const { worldTransform, worldRenderBounds } = leaf;
137
175
  if (worldRenderBounds.width && worldRenderBounds.height && (!bounds || bounds.hit(worldRenderBounds, options.matrix))) {
138
176
  const aScaleX = abs(worldTransform.scaleX), aScaleY = abs(worldTransform.scaleY);
177
+ copy$1(matrix, worldTransform);
178
+ matrix.half = strokeWidth % 2;
139
179
  if (aScaleX !== aScaleY) {
140
- copy$1(matrix, worldTransform);
141
180
  scale(matrix, 1 / aScaleX, 1 / aScaleY);
142
181
  canvas.setWorld(matrix, options.matrix);
143
182
  canvas.beginPath();
@@ -146,7 +185,7 @@ class Stroker extends UI {
146
185
  canvas.rect(x * aScaleX, y * aScaleY, width * aScaleX, height * aScaleY);
147
186
  }
148
187
  else {
149
- canvas.setWorld(worldTransform, options.matrix);
188
+ canvas.setWorld(matrix, options.matrix);
150
189
  canvas.beginPath();
151
190
  if (leaf.__.__useArrow)
152
191
  leaf.__drawPath(canvas);
@@ -181,7 +220,8 @@ class SelectArea extends Group {
181
220
  super(data);
182
221
  this.strokeArea = new Rect({ strokeAlign: 'center' });
183
222
  this.fillArea = new Rect();
184
- this.visible = this.hittable = false;
223
+ this.visible = 0;
224
+ this.hittable = false;
185
225
  this.addMany(this.fillArea, this.strokeArea);
186
226
  }
187
227
  setStyle(style, userStyle) {
@@ -378,7 +418,7 @@ class EditSelect extends Group {
378
418
  if (e.multiTouch)
379
419
  return;
380
420
  if (this.dragging)
381
- this.originList = null, this.selectArea.visible = false;
421
+ this.originList = null, this.selectArea.visible = 0;
382
422
  }
383
423
  onAutoMove(e) {
384
424
  if (this.dragging) {
@@ -526,8 +566,11 @@ const EditDataHelper = {
526
566
  scaleY = scaleY < 0 ? -scale : scale;
527
567
  }
528
568
  }
529
- scaleX /= changedScaleX;
530
- scaleY /= changedScaleY;
569
+ const useScaleX = scaleX !== 1, useScaleY = scaleY !== 1;
570
+ if (useScaleX)
571
+ scaleX /= changedScaleX;
572
+ if (useScaleY)
573
+ scaleY /= changedScaleY;
531
574
  if (!flipable) {
532
575
  const { worldTransform } = element;
533
576
  if (scaleX < 0)
@@ -542,22 +585,27 @@ const EditDataHelper = {
542
585
  localBounds.scaleOf(element.getLocalPointByInner(origin), scaleX, scaleY);
543
586
  if (!BoundsHelper.includes(allowBounds, localBounds)) {
544
587
  const realBounds = localBounds.getIntersect(allowBounds);
545
- scaleX *= realBounds.width / localBounds.width;
546
- scaleY *= realBounds.height / localBounds.height;
588
+ const fitScaleX = realBounds.width / localBounds.width, fitScaleY = realBounds.height / localBounds.height;
589
+ if (useScaleX)
590
+ scaleX *= fitScaleX;
591
+ if (useScaleY)
592
+ scaleY *= fitScaleY;
547
593
  }
548
594
  }
549
- if (widthRange) {
595
+ if (useScaleX && widthRange) {
550
596
  const nowWidth = boxBounds.width * element.scaleX;
551
597
  scaleX = within(nowWidth * scaleX, widthRange) / nowWidth;
552
598
  }
553
- if (heightRange) {
599
+ if (useScaleY && heightRange) {
554
600
  const nowHeight = boxBounds.height * element.scaleY;
555
601
  scaleY = within(nowHeight * scaleY, heightRange) / nowHeight;
556
602
  }
557
- if (Math.abs(scaleX * worldBoxBounds.width) < 1)
603
+ if (useScaleX && Math.abs(scaleX * worldBoxBounds.width) < 1)
558
604
  scaleX = (scaleX < 0 ? -1 : 1) / worldBoxBounds.width;
559
- if (Math.abs(scaleY * worldBoxBounds.height) < 1)
605
+ if (useScaleY && Math.abs(scaleY * worldBoxBounds.height) < 1)
560
606
  scaleY = (scaleY < 0 ? -1 : 1) / worldBoxBounds.height;
607
+ if (lockRatio && scaleX !== scaleY)
608
+ scaleY = scaleX = Math.min(scaleX, scaleY);
561
609
  return { origin, scaleX, scaleY, direction, lockRatio, around };
562
610
  },
563
611
  getRotateData(bounds, direction, current, last, around) {
@@ -728,7 +776,7 @@ class EditBox extends Group {
728
776
  this.view = new Group();
729
777
  this.rect = new Box({ name: 'rect', hitFill: 'all', hitStroke: 'none', strokeAlign: 'center', hitRadius: 5 });
730
778
  this.circle = new EditPoint({ name: 'circle', strokeAlign: 'center', around: 'center', cursor: 'crosshair', hitRadius: 5 });
731
- this.buttons = new Group({ around: 'center', hitSelf: false });
779
+ this.buttons = new Group({ around: 'center', hitSelf: false, visible: 0 });
732
780
  this.resizePoints = [];
733
781
  this.rotatePoints = [];
734
782
  this.resizeLines = [];
@@ -783,12 +831,13 @@ class EditBox extends Group {
783
831
  }
784
832
  }
785
833
  update(bounds) {
786
- const { mergeConfig, element, multiple } = this.editor;
787
- const { middlePoint, resizeable, rotateable, hideOnSmall, editBox } = mergeConfig;
834
+ const { rect, circle, buttons, resizePoints, rotatePoints, resizeLines, editor } = this;
835
+ const { mergeConfig, element, multiple, editMask } = editor;
836
+ const { middlePoint, resizeable, rotateable, hideOnSmall, editBox, mask } = mergeConfig;
788
837
  this.visible = !element.locked;
838
+ editMask.visible = mask ? true : 0;
789
839
  if (this.view.worldOpacity) {
790
840
  const { width, height } = bounds;
791
- const { rect, circle, buttons, resizePoints, rotatePoints, resizeLines } = this;
792
841
  const smallSize = typeof hideOnSmall === 'number' ? hideOnSmall : 10;
793
842
  const showPoints = editBox && !(hideOnSmall && width < smallSize && height < smallSize);
794
843
  let point = {}, rotateP, resizeP, resizeL;
@@ -823,10 +872,12 @@ class EditBox extends Group {
823
872
  if (rect.path)
824
873
  rect.path = null;
825
874
  rect.set(Object.assign(Object.assign({}, bounds), { visible: multiple ? true : editBox }));
826
- buttons.visible = showPoints && buttons.children.length > 0;
875
+ buttons.visible = showPoints && buttons.children.length > 0 || 0;
827
876
  if (buttons.visible)
828
877
  this.layoutButtons(mergeConfig);
829
878
  }
879
+ else
880
+ rect.set(bounds);
830
881
  }
831
882
  layoutCircle(config) {
832
883
  const { circleDirection, circleMargin, buttonsMargin, buttonsDirection, middlePoint } = config;
@@ -889,7 +940,7 @@ class EditBox extends Group {
889
940
  }
890
941
  onDragStart(e) {
891
942
  this.dragging = true;
892
- const point = this.dragPoint = e.current;
943
+ const point = this.dragPoint = e.current, { pointType } = point;
893
944
  const { editor, dragStartData } = this, { element } = editor;
894
945
  if (point.name === 'rect') {
895
946
  this.moving = true;
@@ -900,43 +951,53 @@ class EditBox extends Group {
900
951
  dragStartData.point = { x: element.x, y: element.y };
901
952
  dragStartData.bounds = Object.assign({}, element.getLayoutBounds('box', 'local'));
902
953
  dragStartData.rotation = element.rotation;
954
+ if (pointType && pointType.includes('resize'))
955
+ ResizeEvent.resizingKeys = editor.leafList.keys;
903
956
  }
904
957
  onDragEnd(e) {
905
958
  this.dragging = false;
906
959
  this.dragPoint = null;
907
960
  this.moving = false;
908
- if (e.current.name === 'rect')
961
+ const { name, pointType } = e.current;
962
+ if (name === 'rect')
909
963
  this.editor.opacity = 1;
964
+ if (pointType && pointType.includes('resize'))
965
+ ResizeEvent.resizingKeys = null;
910
966
  }
911
967
  onDrag(e) {
912
968
  const { editor } = this;
913
969
  const { pointType } = this.enterPoint = e.current;
914
- if (pointType.includes('rotate') || e.metaKey || e.ctrlKey || !editor.mergeConfig.resizeable)
970
+ if (pointType.includes('rotate') || e.metaKey || e.ctrlKey || !editor.mergeConfig.resizeable) {
915
971
  editor.onRotate(e);
916
- if (pointType.includes('resize'))
972
+ if (pointType === 'resize-rotate')
973
+ editor.onScale(e);
974
+ }
975
+ else if (pointType === 'resize')
917
976
  editor.onScale(e);
918
977
  if (pointType === 'skew')
919
978
  editor.onSkew(e);
920
979
  updateCursor(editor, e);
921
980
  }
922
981
  onArrow(e) {
923
- if (this.editor.editing && this.editor.mergeConfig.keyEvent) {
924
- const move = { x: 0, y: 0 };
982
+ const { editor } = this;
983
+ if (editor.editing && editor.mergeConfig.keyEvent) {
984
+ let x = 0, y = 0;
925
985
  const distance = e.shiftKey ? 10 : 1;
926
986
  switch (e.code) {
927
987
  case 'ArrowDown':
928
- move.y = distance;
988
+ y = distance;
929
989
  break;
930
990
  case 'ArrowUp':
931
- move.y = -distance;
991
+ y = -distance;
932
992
  break;
933
993
  case 'ArrowLeft':
934
- move.x = -distance;
994
+ x = -distance;
935
995
  break;
936
996
  case 'ArrowRight':
937
- move.x = distance;
997
+ x = distance;
938
998
  }
939
- this.editor.move(move);
999
+ if (x || y)
1000
+ editor.move(x, y);
940
1001
  }
941
1002
  }
942
1003
  onDoubleTap(e) {
@@ -1002,22 +1063,32 @@ class EditBox extends Group {
1002
1063
  }
1003
1064
  }
1004
1065
 
1066
+ const bigBounds = { x: 0, y: 0, width: 100000, height: 100000 };
1005
1067
  class EditMask extends UI {
1006
1068
  constructor(editor) {
1007
1069
  super();
1008
1070
  this.editor = editor;
1009
1071
  this.hittable = false;
1072
+ this.visible = 0;
1073
+ }
1074
+ __updateWorldBounds() {
1075
+ Object.assign(this.__local, bigBounds);
1076
+ Object.assign(this.__world, bigBounds);
1010
1077
  }
1011
1078
  __draw(canvas, options) {
1012
- const { editor } = this;
1013
- const { mask } = editor.mergeConfig;
1014
- if (mask && editor.list.length) {
1015
- const { rect } = editor.editBox;
1016
- const { width, height } = rect.__;
1017
- canvas.resetTransform();
1079
+ const { editor } = this, { mask } = editor.mergedConfig;
1080
+ if (mask && editor.editing) {
1018
1081
  canvas.fillWorld(canvas.bounds, mask === true ? 'rgba(0,0,0,0.8)' : mask);
1019
- canvas.setWorld(rect.__world, options.matrix);
1020
- canvas.clearRect(0, 0, width, height);
1082
+ if (options.bounds && !options.bounds.hit(editor.editBox.rect.__world, options.matrix))
1083
+ return;
1084
+ canvas.saveBlendMode('destination-out');
1085
+ editor.list.forEach(item => {
1086
+ item.__renderShape(canvas, options);
1087
+ const { __box, parent } = item;
1088
+ if ((item = __box) || ((item = parent) && parent.textBox))
1089
+ item.__renderShape(canvas, options);
1090
+ });
1091
+ canvas.restoreBlendMode();
1021
1092
  }
1022
1093
  }
1023
1094
  destroy() {
@@ -1125,11 +1196,7 @@ function simulate(editor) {
1125
1196
  function onTarget(editor, oldValue) {
1126
1197
  const { target } = editor;
1127
1198
  if (target) {
1128
- const { list } = editor.leafList = target instanceof LeafList ? target : new LeafList(target instanceof Array ? target : target);
1129
- if (!list.every(checkEditable)) {
1130
- editor.target = list.filter(checkEditable);
1131
- return;
1132
- }
1199
+ editor.leafList = target instanceof LeafList ? target : new LeafList(target);
1133
1200
  if (editor.multiple)
1134
1201
  simulate(editor);
1135
1202
  }
@@ -1156,9 +1223,6 @@ function onTarget(editor, oldValue) {
1156
1223
  function onHover(editor, oldValue) {
1157
1224
  editor.emitEvent(new EditorEvent(EditorEvent.HOVER, { editor, value: editor.hoverTarget, oldValue }));
1158
1225
  }
1159
- function checkEditable(item) {
1160
- return item.editable && !item.locked;
1161
- }
1162
1226
 
1163
1227
  const order = (a, b) => a.parent.children.indexOf(a) - b.parent.children.indexOf(b);
1164
1228
  const reverseOrder = (a, b) => b.parent.children.indexOf(b) - a.parent.children.indexOf(a);
@@ -1327,22 +1391,6 @@ class SimulateElement extends Rect {
1327
1391
  }
1328
1392
 
1329
1393
  class Editor extends Group {
1330
- get mergeConfig() {
1331
- const { config, element, dragPoint } = this, mergeConfig = Object.assign({}, config);
1332
- if (element && element.editConfig)
1333
- Object.assign(mergeConfig, element.editConfig);
1334
- if (dragPoint) {
1335
- if (dragPoint.editConfig)
1336
- Object.assign(mergeConfig, dragPoint.editConfig);
1337
- if (mergeConfig.editSize === 'font-size')
1338
- mergeConfig.lockRatio = true;
1339
- if (dragPoint.pointType === 'resize-rotate') {
1340
- mergeConfig.around || (mergeConfig.around = 'center');
1341
- isNull(mergeConfig.lockRatio) && (mergeConfig.lockRatio = true);
1342
- }
1343
- }
1344
- return mergeConfig;
1345
- }
1346
1394
  get list() { return this.leafList.list; }
1347
1395
  get dragHoverExclude() { return [this.editBox.rect]; }
1348
1396
  get editing() { return !!this.list.length; }
@@ -1356,7 +1404,6 @@ class Editor extends Group {
1356
1404
  get buttons() { return this.editBox.buttons; }
1357
1405
  constructor(userConfig, data) {
1358
1406
  super(data);
1359
- this.config = DataHelper.clone(config);
1360
1407
  this.leafList = new LeafList();
1361
1408
  this.openedGroupList = new LeafList();
1362
1409
  this.simulateTarget = new SimulateElement(this);
@@ -1365,8 +1412,10 @@ class Editor extends Group {
1365
1412
  this.selector = new EditSelect(this);
1366
1413
  this.editMask = new EditMask(this);
1367
1414
  this.targetEventIds = [];
1415
+ let mergedConfig = DataHelper.clone(config);
1368
1416
  if (userConfig)
1369
- this.config = DataHelper.default(userConfig, this.config);
1417
+ mergedConfig = DataHelper.default(userConfig, mergedConfig);
1418
+ this.mergedConfig = this.config = mergedConfig;
1370
1419
  this.addMany(this.editMask, this.selector, this.editBox);
1371
1420
  if (!Plugin.has('resize'))
1372
1421
  this.config.editSize = 'scale';
@@ -1706,8 +1755,7 @@ class Editor extends Group {
1706
1755
  }
1707
1756
  }
1708
1757
  emitInnerEvent(type) {
1709
- const { innerEditor } = this;
1710
- const { editTarget } = innerEditor;
1758
+ const { innerEditor } = this, { editTarget } = innerEditor;
1711
1759
  const event = new InnerEditorEvent(type, { editTarget, innerEditor });
1712
1760
  this.emitEvent(event);
1713
1761
  editTarget.emitEvent(event);
@@ -1732,25 +1780,40 @@ class Editor extends Group {
1732
1780
  this.leafList.update();
1733
1781
  }
1734
1782
  }
1783
+ onAppRenderStart(app) {
1784
+ if (this.targetChanged = app.children.some(leafer => leafer !== this.leafer && leafer.renderer.changed))
1785
+ this.editBox.forceRender();
1786
+ }
1787
+ onRenderStart() {
1788
+ if (this.targetChanged)
1789
+ this.update();
1790
+ }
1791
+ onKey(e) {
1792
+ updateCursor(this, e);
1793
+ }
1735
1794
  listenTargetEvents() {
1736
1795
  if (!this.targetEventIds.length) {
1737
- const { app, leafer } = this;
1796
+ const { app, leafer, editBox, editMask } = this;
1738
1797
  this.targetEventIds = [
1739
- leafer.on_(RenderEvent.START, this.update, this),
1740
- app.on_(RenderEvent.CHILD_START, this.forceRender, this),
1798
+ leafer.on_(RenderEvent.START, this.onRenderStart, this),
1799
+ app.on_(RenderEvent.CHILD_START, this.onAppRenderStart, this),
1741
1800
  app.on_(MoveEvent.BEFORE_MOVE, this.onMove, this, true),
1742
1801
  app.on_(ZoomEvent.BEFORE_ZOOM, this.onScale, this, true),
1743
1802
  app.on_(RotateEvent.BEFORE_ROTATE, this.onRotate, this, true),
1744
- app.on_([KeyEvent.HOLD, KeyEvent.UP], (e) => { updateCursor(this, e); }),
1745
- app.on_(KeyEvent.DOWN, this.editBox.onArrow, this.editBox)
1803
+ app.on_([KeyEvent.HOLD, KeyEvent.UP], this.onKey, this),
1804
+ app.on_(KeyEvent.DOWN, editBox.onArrow, editBox)
1746
1805
  ];
1806
+ if (editMask.visible)
1807
+ editMask.forceRender();
1747
1808
  }
1748
1809
  }
1749
1810
  removeTargetEvents() {
1750
- const { targetEventIds } = this;
1811
+ const { targetEventIds, editMask } = this;
1751
1812
  if (targetEventIds.length) {
1752
1813
  this.off_(targetEventIds);
1753
1814
  targetEventIds.length = 0;
1815
+ if (editMask.visible)
1816
+ editMask.forceRender();
1754
1817
  }
1755
1818
  }
1756
1819
  destroy() {
@@ -1764,6 +1827,9 @@ class Editor extends Group {
1764
1827
  }
1765
1828
  }
1766
1829
  }
1830
+ __decorate([
1831
+ mergeConfigAttr()
1832
+ ], Editor.prototype, "mergeConfig", void 0);
1767
1833
  __decorate([
1768
1834
  targetAttr(onHover)
1769
1835
  ], Editor.prototype, "hoverTarget", void 0);
@@ -1828,9 +1894,7 @@ let EditTool = class EditTool extends InnerEditor {
1828
1894
  const { moveX, moveY, editor } = e;
1829
1895
  const { app, list } = editor;
1830
1896
  app.lockLayout();
1831
- list.forEach(target => {
1832
- target.moveWorld(moveX, moveY);
1833
- });
1897
+ list.forEach(target => { target.moveWorld(moveX, moveY); });
1834
1898
  app.unlockLayout();
1835
1899
  }
1836
1900
  onScale(e) {
@@ -1839,12 +1903,10 @@ let EditTool = class EditTool extends InnerEditor {
1839
1903
  app.lockLayout();
1840
1904
  list.forEach(target => {
1841
1905
  const resize = editor.getEditSize(target) !== 'scale';
1842
- if (transform) {
1906
+ if (transform)
1843
1907
  target.transformWorld(transform, resize);
1844
- }
1845
- else {
1908
+ else
1846
1909
  target.scaleOfWorld(worldOrigin, scaleX, scaleY, resize);
1847
- }
1848
1910
  });
1849
1911
  app.unlockLayout();
1850
1912
  }
@@ -1854,12 +1916,10 @@ let EditTool = class EditTool extends InnerEditor {
1854
1916
  app.lockLayout();
1855
1917
  list.forEach(target => {
1856
1918
  const resize = editor.getEditSize(target) !== 'scale';
1857
- if (transform) {
1919
+ if (transform)
1858
1920
  target.transformWorld(transform, resize);
1859
- }
1860
- else {
1921
+ else
1861
1922
  target.rotateOfWorld(worldOrigin, rotation);
1862
- }
1863
1923
  });
1864
1924
  app.unlockLayout();
1865
1925
  }
@@ -1869,12 +1929,10 @@ let EditTool = class EditTool extends InnerEditor {
1869
1929
  app.lockLayout();
1870
1930
  list.forEach(target => {
1871
1931
  const resize = editor.getEditSize(target) !== 'scale';
1872
- if (transform) {
1932
+ if (transform)
1873
1933
  target.transformWorld(transform, resize);
1874
- }
1875
- else {
1934
+ else
1876
1935
  target.skewOfWorld(worldOrigin, skewX, skewY, resize);
1877
- }
1878
1936
  });
1879
1937
  app.unlockLayout();
1880
1938
  }