fabric 6.0.0-beta11 → 6.0.0-beta13

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.
Files changed (59) hide show
  1. package/.gitmodules +3 -0
  2. package/.prettierignore +4 -3
  3. package/CHANGELOG.md +24 -0
  4. package/CONTRIBUTING.md +3 -1
  5. package/dist/index.js +110 -80
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.min.js +1 -1
  8. package/dist/index.mjs +110 -80
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/index.node.cjs +110 -80
  11. package/dist/index.node.cjs.map +1 -1
  12. package/dist/index.node.mjs +110 -80
  13. package/dist/index.node.mjs.map +1 -1
  14. package/dist/src/Collection.d.ts +1 -1
  15. package/dist/src/EventTypeDefs.d.ts +1 -0
  16. package/dist/src/canvas/SelectableCanvas.d.ts +4 -4
  17. package/dist/src/shapes/ActiveSelection.d.ts +15 -3
  18. package/dist/src/shapes/IText/ITextBehavior.d.ts +1 -1
  19. package/dist/src/shapes/Object/ObjectOrigin.d.ts +0 -14
  20. package/dist/src/shapes/Object/types/ObjectProps.d.ts +9 -0
  21. package/dist/src/shapes/Text/Text.d.ts +2 -2
  22. package/dist/src/shapes/Textbox.d.ts +3 -1
  23. package/dist/src/util/animation/types.d.ts +1 -1
  24. package/jest.config.js +1 -1
  25. package/jest.extend.ts +123 -0
  26. package/jest.setup.ts +5 -0
  27. package/package.json +4 -3
  28. package/playwright.setup.ts +1 -1
  29. package/src/Collection.ts +1 -1
  30. package/src/EventTypeDefs.ts +1 -0
  31. package/src/canvas/Canvas.ts +22 -16
  32. package/src/canvas/SelectableCanvas.ts +5 -4
  33. package/src/canvas/__tests__/__snapshots__/eventData.test.ts.snap +581 -0
  34. package/src/canvas/__tests__/eventData.test.ts +102 -0
  35. package/src/controls/polyControl.ts +12 -14
  36. package/src/controls/scale.ts +1 -1
  37. package/src/controls/wrapWithFixedAnchor.spec.ts +122 -0
  38. package/src/controls/wrapWithFixedAnchor.ts +7 -1
  39. package/src/shapes/ActiveSelection.spec.ts +89 -0
  40. package/src/shapes/ActiveSelection.ts +33 -11
  41. package/src/shapes/IText/ITextBehavior.test.ts +3 -4
  42. package/src/shapes/IText/ITextBehavior.ts +2 -1
  43. package/src/shapes/IText/__snapshots__/ITextBehavior.test.ts.snap +0 -6
  44. package/src/shapes/Object/InteractiveObject.ts +4 -1
  45. package/src/shapes/Object/Object.spec.ts +61 -0
  46. package/src/shapes/Object/Object.ts +18 -8
  47. package/src/shapes/Object/ObjectOrigin.ts +0 -48
  48. package/src/shapes/Object/types/ObjectProps.ts +10 -0
  49. package/src/shapes/Text/Text.spec.ts +3 -3
  50. package/src/shapes/Text/Text.ts +5 -4
  51. package/src/shapes/Text/__snapshots__/Text.spec.ts.snap +1 -1
  52. package/src/shapes/Textbox.spec.ts +4 -5
  53. package/src/shapes/Textbox.ts +6 -4
  54. package/src/shapes/__snapshots__/ActiveSelection.spec.ts.snap +43 -0
  55. package/src/shapes/__snapshots__/Textbox.spec.ts.snap +2 -3
  56. package/src/util/animation/types.ts +2 -1
  57. package/src/util/dom_misc.ts +3 -2
  58. package/typedoc.json +10 -0
  59. package/toMatchRoundedSnapshot.ts +0 -66
package/dist/index.mjs CHANGED
@@ -393,7 +393,7 @@ class Cache {
393
393
  }
394
394
  const cache = new Cache();
395
395
 
396
- var version = "6.0.0-beta11";
396
+ var version = "6.0.0-beta13";
397
397
 
398
398
  // use this syntax so babel plugin see this import here
399
399
  const VERSION = version;
@@ -1252,7 +1252,7 @@ function createCollectionMixin(Base) {
1252
1252
 
1253
1253
  /**
1254
1254
  * Returns true if collection contains an object.\
1255
- * **Prefer using {@link `FabricObject#isDescendantOf`} for performance reasons**
1255
+ * **Prefer using {@link FabricObject#isDescendantOf} for performance reasons**
1256
1256
  * instead of `a.contains(b)` use `b.isDescendantOf(a)`
1257
1257
  * @param {Object} object Object to check against
1258
1258
  * @param {Boolean} [deep=false] `true` to check all descendants, `false` to check only `_objects`
@@ -2765,15 +2765,15 @@ const isFabricObjectWithDragSupport = fabricObject => {
2765
2765
  * @return {Object} Object with left/top values
2766
2766
  */
2767
2767
  function getScrollLeftTop(element) {
2768
+ const doc = element && getDocumentFromElement(element);
2768
2769
  let left = 0,
2769
2770
  top = 0;
2770
- if (!element) {
2771
+ if (!element || !doc) {
2771
2772
  return {
2772
2773
  left,
2773
2774
  top
2774
2775
  };
2775
2776
  }
2776
- const doc = getDocumentFromElement(element);
2777
2777
  const docElement = doc.documentElement,
2778
2778
  body = doc.body || {
2779
2779
  scrollLeft: 0,
@@ -5914,38 +5914,6 @@ class ObjectOrigin extends CommonMethods {
5914
5914
  });
5915
5915
  }
5916
5916
 
5917
- /**
5918
- * Sets the origin/position of the object to it's center point
5919
- * @private
5920
- * @return {void}
5921
- */
5922
- _setOriginToCenter() {
5923
- this._originalOriginX = this.originX;
5924
- this._originalOriginY = this.originY;
5925
- const center = this.getRelativeCenterPoint();
5926
- this.originX = CENTER;
5927
- this.originY = CENTER;
5928
- this.left = center.x;
5929
- this.top = center.y;
5930
- }
5931
-
5932
- /**
5933
- * Resets the origin/position of the object to it's original origin
5934
- * @private
5935
- * @return {void}
5936
- */
5937
- _resetOrigin() {
5938
- if (this._originalOriginX !== undefined && this._originalOriginY !== undefined) {
5939
- const originPoint = this.translateToOriginPoint(this.getRelativeCenterPoint(), this._originalOriginX, this._originalOriginY);
5940
- this.left = originPoint.x;
5941
- this.top = originPoint.y;
5942
- this.originX = this._originalOriginX;
5943
- this.originY = this._originalOriginY;
5944
- this._originalOriginX = undefined;
5945
- this._originalOriginY = undefined;
5946
- }
5947
- }
5948
-
5949
5917
  /**
5950
5918
  * @private
5951
5919
  */
@@ -8210,13 +8178,31 @@ let FabricObject$1 = class FabricObject extends AnimatableObject {
8210
8178
  * @param {TDegree} angle Angle value (in degrees)
8211
8179
  */
8212
8180
  rotate(angle) {
8213
- const shouldCenterOrigin = (this.originX !== CENTER || this.originY !== CENTER) && this.centeredRotation;
8214
- if (shouldCenterOrigin) {
8215
- this._setOriginToCenter();
8181
+ const {
8182
+ centeredRotation,
8183
+ originX,
8184
+ originY
8185
+ } = this;
8186
+ if (centeredRotation) {
8187
+ const {
8188
+ x,
8189
+ y
8190
+ } = this.getRelativeCenterPoint();
8191
+ this.originX = CENTER;
8192
+ this.originY = CENTER;
8193
+ this.left = x;
8194
+ this.top = y;
8216
8195
  }
8217
8196
  this.set('angle', angle);
8218
- if (shouldCenterOrigin) {
8219
- this._resetOrigin();
8197
+ if (centeredRotation) {
8198
+ const {
8199
+ x,
8200
+ y
8201
+ } = this.translateToOriginPoint(this.getRelativeCenterPoint(), originX, originY);
8202
+ this.left = x;
8203
+ this.top = y;
8204
+ this.originX = originX;
8205
+ this.originY = originY;
8220
8206
  }
8221
8207
  }
8222
8208
 
@@ -8350,7 +8336,9 @@ function wrapWithFixedAnchor(actionHandler) {
8350
8336
  centerPoint = target.getRelativeCenterPoint(),
8351
8337
  constraint = target.translateToOriginPoint(centerPoint, originX, originY),
8352
8338
  actionPerformed = actionHandler(eventData, transform, x, y);
8353
- target.setPositionByOrigin(constraint, originX, originY);
8339
+ // flipping requires to change the transform origin, so we read from the mutated transform
8340
+ // instead of leveraging the one destructured before
8341
+ target.setPositionByOrigin(constraint, transform.originX, transform.originY);
8354
8342
  return actionPerformed;
8355
8343
  };
8356
8344
  }
@@ -8956,7 +8944,7 @@ function scaleObject(eventData, transform, x, y) {
8956
8944
  transform.signY = signY;
8957
8945
  }
8958
8946
  }
8959
- // minScale is taken are in the setter.
8947
+ // minScale is taken care of in the setter.
8960
8948
  const oldScaleX = target.scaleX,
8961
8949
  oldScaleY = target.scaleY;
8962
8950
  if (!by) {
@@ -9600,7 +9588,7 @@ class InteractiveFabricObject extends FabricObject$1 {
9600
9588
  // this is extremely confusing. options comes from the upper function
9601
9589
  // and is the qrDecompose of a matrix that takes in account zoom too
9602
9590
  new Point(options.scaleX, options.scaleY)).scalarMultiply(this.strokeWidth);
9603
- size = bbox.add(stroke).scalarAdd(this.borderScaleFactor);
9591
+ size = bbox.add(stroke).scalarAdd(this.borderScaleFactor).scalarAdd(this.padding * 2);
9604
9592
  } else {
9605
9593
  size = this._calculateCurrentDimensions().scalarAdd(this.borderScaleFactor);
9606
9594
  }
@@ -11345,9 +11333,22 @@ _defineProperty(Group, "type", 'Group');
11345
11333
  _defineProperty(Group, "ownDefaults", groupDefaultValues);
11346
11334
  classRegistry.setClass(Group);
11347
11335
 
11336
+ /**
11337
+ * Used by Canvas to manage selection.
11338
+ * Canvas accepts an `activeSelection` option allowing overriding and customization.
11339
+ *
11340
+ * @example
11341
+ * class MyActiveSelection extends ActiveSelection {
11342
+ * ...
11343
+ * }
11344
+ *
11345
+ * const canvas = new Canvas(el, {
11346
+ * activeSelection: new MyActiveSelection()
11347
+ * })
11348
+ */
11348
11349
  class ActiveSelection extends Group {
11349
- constructor(objects, options, objectsRelativeToGroup) {
11350
- super(objects, options, objectsRelativeToGroup);
11350
+ constructor() {
11351
+ super(...arguments);
11351
11352
  /**
11352
11353
  * controls how selected objects are added during a multiselection event
11353
11354
  * - `canvas-stacking` adds the selected object to the active selection while respecting canvas object stacking order
@@ -11357,9 +11358,7 @@ class ActiveSelection extends Group {
11357
11358
  */
11358
11359
  // TODO FIX THIS WITH THE DEFAULTS LOGIC
11359
11360
  _defineProperty(this, "multiSelectionStacking", 'canvas-stacking');
11360
- this.setCoords();
11361
11361
  }
11362
-
11363
11362
  /**
11364
11363
  * @private
11365
11364
  */
@@ -11464,6 +11463,24 @@ class ActiveSelection extends Group {
11464
11463
  this.removeAll();
11465
11464
  return false;
11466
11465
  }
11466
+ _applyLayoutStrategy(context) {
11467
+ super._applyLayoutStrategy(context);
11468
+ if (this._objects.length === 0) {
11469
+ // in this case layout was skipped
11470
+ // we reset transform for the next selection
11471
+ Object.assign(this, {
11472
+ left: 0,
11473
+ top: 0,
11474
+ angle: 0,
11475
+ scaleX: 1,
11476
+ scaleY: 1,
11477
+ skewX: 0,
11478
+ skewY: 0,
11479
+ flipX: false,
11480
+ flipY: false
11481
+ });
11482
+ }
11483
+ }
11467
11484
 
11468
11485
  /**
11469
11486
  * Returns string representation of a group
@@ -13516,6 +13533,7 @@ class SelectableCanvas extends StaticCanvas {
13516
13533
  _defineProperty(this, "_activeSelection", void 0);
13517
13534
  this._activeSelection = activeSelection;
13518
13535
  this._activeSelection.set('canvas', this);
13536
+ this._activeSelection.setCoords();
13519
13537
  }
13520
13538
  initElements(el) {
13521
13539
  this.elements = new CanvasDOMManager(el, {
@@ -13960,7 +13978,7 @@ class SelectableCanvas extends StaticCanvas {
13960
13978
 
13961
13979
  /**
13962
13980
  * Function used to search inside objects an object that contains pointer in bounding box or that contains pointerOnCanvas when painted
13963
- * @see {@link fabric.Canvas#_searchPossibleTargets}
13981
+ * @see {@link _searchPossibleTargets}
13964
13982
  * @param {FabricObject[]} [objects] objects array to look into
13965
13983
  * @param {Object} [pointer] x,y object of point coordinates we want to check.
13966
13984
  * @return {FabricObject} **top most object on screen** that contains pointer
@@ -13991,9 +14009,9 @@ class SelectableCanvas extends StaticCanvas {
13991
14009
  * by the viewportTransform ( sort of coordinates of what is displayed
13992
14010
  * on the canvas where you are clicking.
13993
14011
  * ignoreVpt true = HTMLElement coordinates relative to top,left
13994
- * ignoreVpt false, default = fabric space coordinates, the same used for shape position
13995
- * To interact with your shapes top and left you want to use ignoreVpt true
13996
- * most of the time, while ignoreVpt false will give you coordinates
14012
+ * ignoreVpt false, default = fabric space coordinates, the same used for shape position.
14013
+ * To interact with your shapes top and left you want to use ignoreVpt false
14014
+ * most of the time, while ignoreVpt true will give you coordinates
13997
14015
  * compatible with the object.oCoords system.
13998
14016
  * of the time.
13999
14017
  * @param {Event} e
@@ -14580,8 +14598,8 @@ class Canvas extends SelectableCanvas {
14580
14598
  const shared = {
14581
14599
  e,
14582
14600
  isClick: false,
14583
- pointer: this.getPointer(e),
14584
- absolutePointer: this.getPointer(e, true)
14601
+ pointer: this.getPointer(e, true),
14602
+ absolutePointer: this.getPointer(e)
14585
14603
  };
14586
14604
  this.fire('mouse:out', _objectSpread2(_objectSpread2({}, shared), {}, {
14587
14605
  target
@@ -14612,8 +14630,8 @@ class Canvas extends SelectableCanvas {
14612
14630
  this.fire('mouse:over', {
14613
14631
  e,
14614
14632
  isClick: false,
14615
- pointer: this.getPointer(e),
14616
- absolutePointer: this.getPointer(e, true)
14633
+ pointer: this.getPointer(e, true),
14634
+ absolutePointer: this.getPointer(e)
14617
14635
  });
14618
14636
  this._hoveredTarget = undefined;
14619
14637
  this._hoveredTargets = [];
@@ -14845,7 +14863,8 @@ class Canvas extends SelectableCanvas {
14845
14863
  target,
14846
14864
  subTargets: targets,
14847
14865
  dragSource: this._dragSource,
14848
- pointer: this.getPointer(e)
14866
+ pointer: this.getPointer(e, true),
14867
+ absolutePointer: this.getPointer(e)
14849
14868
  });
14850
14869
  // will be set by the drop target
14851
14870
  options.didDrop = false;
@@ -15162,8 +15181,8 @@ class Canvas extends SelectableCanvas {
15162
15181
  subTargets: targets,
15163
15182
  button,
15164
15183
  isClick,
15165
- pointer: this.getPointer(e),
15166
- absolutePointer: this.getPointer(e, true),
15184
+ pointer: this.getPointer(e, true),
15185
+ absolutePointer: this.getPointer(e),
15167
15186
  transform: this._currentTransform
15168
15187
  };
15169
15188
  if (eventType === 'up') {
@@ -15227,6 +15246,7 @@ class Canvas extends SelectableCanvas {
15227
15246
  this.discardActiveObject(e);
15228
15247
  this.requestRenderAll();
15229
15248
  }
15249
+ // this is an absolute pointer, the naming is wrong
15230
15250
  const pointer = this.getPointer(e);
15231
15251
  this.freeDrawingBrush && this.freeDrawingBrush.onMouseDown(pointer, {
15232
15252
  e,
@@ -15244,6 +15264,7 @@ class Canvas extends SelectableCanvas {
15244
15264
  const pointer = this.getPointer(e);
15245
15265
  this.freeDrawingBrush && this.freeDrawingBrush.onMouseMove(pointer, {
15246
15266
  e,
15267
+ // this is an absolute pointer, the naming is wrong
15247
15268
  pointer
15248
15269
  });
15249
15270
  }
@@ -15260,6 +15281,7 @@ class Canvas extends SelectableCanvas {
15260
15281
  if (this.freeDrawingBrush) {
15261
15282
  this._isCurrentlyDrawing = !!this.freeDrawingBrush.onMouseUp({
15262
15283
  e: e,
15284
+ // this is an absolute pointer, the naming is wrong
15263
15285
  pointer: pointer
15264
15286
  });
15265
15287
  } else {
@@ -15515,8 +15537,8 @@ class Canvas extends SelectableCanvas {
15515
15537
  target: oldTarget,
15516
15538
  nextTarget: target,
15517
15539
  isClick: false,
15518
- pointer: this.getPointer(e),
15519
- absolutePointer: this.getPointer(e, true)
15540
+ pointer: this.getPointer(e, true),
15541
+ absolutePointer: this.getPointer(e)
15520
15542
  });
15521
15543
  fireCanvas && this.fire(canvasIn, outOpt);
15522
15544
  oldTarget.fire(targetOut, outOpt);
@@ -15527,8 +15549,8 @@ class Canvas extends SelectableCanvas {
15527
15549
  target,
15528
15550
  previousTarget: oldTarget,
15529
15551
  isClick: false,
15530
- pointer: this.getPointer(e),
15531
- absolutePointer: this.getPointer(e, true)
15552
+ pointer: this.getPointer(e, true),
15553
+ absolutePointer: this.getPointer(e)
15532
15554
  });
15533
15555
  fireCanvas && this.fire(canvasOut, inOpt);
15534
15556
  target.fire(targetIn, inOpt);
@@ -15656,8 +15678,13 @@ class Canvas extends SelectableCanvas {
15656
15678
  if (isAS) {
15657
15679
  const prevActiveObjects = activeSelection.getObjects();
15658
15680
  if (target === activeSelection) {
15659
- // find target from active objects
15660
- target = this.searchPossibleTargets(prevActiveObjects, this.getPointer(e, true));
15681
+ const pointer = this.getPointer(e, true);
15682
+ target =
15683
+ // first search active objects for a target to remove
15684
+ this.searchPossibleTargets(prevActiveObjects, pointer) ||
15685
+ // if not found, search under active selection for a target to add
15686
+ // `prevActiveObjects` will be searched but we already know they will not be found
15687
+ this.searchPossibleTargets(this._objects, pointer);
15661
15688
  // if nothing is found bail out
15662
15689
  if (!target || !target.selectable) {
15663
15690
  return false;
@@ -19054,10 +19081,10 @@ class Text extends StyledText {
19054
19081
  /**
19055
19082
  * Detect if a line has a linebreak and so we need to account for it when moving
19056
19083
  * and counting style.
19057
- * It return always for text and Itext.
19084
+ * It return always 1 for text and Itext. Textbox has its own implementation
19058
19085
  * @return Number
19059
19086
  */
19060
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
19087
+
19061
19088
  missingNewlineOffset(lineIndex) {
19062
19089
  return 1;
19063
19090
  }
@@ -19077,7 +19104,7 @@ class Text extends StyledText {
19077
19104
  charIndex: selectionStart
19078
19105
  };
19079
19106
  }
19080
- selectionStart -= lines[i].length + this.missingNewlineOffset(i);
19107
+ selectionStart -= lines[i].length + this.missingNewlineOffset(i, skipWrapping);
19081
19108
  }
19082
19109
  return {
19083
19110
  lineIndex: i - 1,
@@ -20541,8 +20568,7 @@ class DraggableTextDelegate {
20541
20568
  * - `!` Matches a "!" character (char code 33).
20542
20569
  * - `\?` Matches a "?" character (char code 63).
20543
20570
  * - `\-` Matches a "-" character (char code 45).
20544
- */
20545
- // eslint-disable-next-line no-useless-escape
20571
+ */ // eslint-disable-next-line no-useless-escape
20546
20572
  const reNonWord = /[ \n\.,;!\?\-]/;
20547
20573
  class ITextBehavior extends Text {
20548
20574
  constructor() {
@@ -20829,7 +20855,7 @@ class ITextBehavior extends Text {
20829
20855
  }
20830
20856
 
20831
20857
  /**
20832
- * called by {@link canvas#textEditingManager}
20858
+ * called by {@link Canvas#textEditingManager}
20833
20859
  */
20834
20860
  updateSelectionOnMouseMove(e) {
20835
20861
  if (this.getActiveControl()) {
@@ -23084,14 +23110,17 @@ class Textbox extends IText {
23084
23110
  let offset = 0;
23085
23111
  const wordsOrGraphemes = splitByGrapheme ? this.graphemeSplit(line) : this.wordSplit(line);
23086
23112
  if (wordsOrGraphemes.length === 0) {
23087
- return [];
23113
+ return [{
23114
+ word: [],
23115
+ width: 0
23116
+ }];
23088
23117
  }
23089
23118
  return wordsOrGraphemes.map(word => {
23090
23119
  // if using splitByGrapheme words are already in graphemes.
23091
23120
  const graphemeArray = splitByGrapheme ? [word] : this.graphemeSplit(word);
23092
23121
  const width = this._measureWord(graphemeArray, lineIndex, offset);
23093
23122
  largestWordWidth = Math.max(width, largestWordWidth);
23094
- offset += word.length + infix.length;
23123
+ offset += graphemeArray.length + infix.length;
23095
23124
  return {
23096
23125
  word: graphemeArray,
23097
23126
  width
@@ -23227,10 +23256,12 @@ class Textbox extends IText {
23227
23256
  /**
23228
23257
  * Detect if a line has a linebreak and so we need to account for it when moving
23229
23258
  * and counting style.
23259
+ * This is important only for splitByGrapheme at the end of wrapping.
23260
+ * If we are not wrapping the offset is always 1
23230
23261
  * @return Number
23231
23262
  */
23232
- missingNewlineOffset(lineIndex) {
23233
- if (this.splitByGrapheme) {
23263
+ missingNewlineOffset(lineIndex, skipWrapping) {
23264
+ if (this.splitByGrapheme && !skipWrapping) {
23234
23265
  return this.isEndOfWrapping(lineIndex) ? 1 : 0;
23235
23266
  }
23236
23267
  return 1;
@@ -25006,15 +25037,14 @@ const polyActionHandler = (eventData, transform, x, y) => {
25006
25037
  const anchorWrapper = (pointIndex, fn) => {
25007
25038
  return function (eventData, transform, x, y) {
25008
25039
  const poly = transform.target,
25009
- anchorIndex = (pointIndex > 0 ? pointIndex : poly.points.length) - 1,
25010
- pointInParentPlane = new Point(poly.points[anchorIndex].x - poly.pathOffset.x, poly.points[anchorIndex].y - poly.pathOffset.y).transform(poly.calcOwnMatrix()),
25040
+ anchorPoint = new Point(poly.points[(pointIndex > 0 ? pointIndex : poly.points.length) - 1]),
25041
+ anchorPointInParentPlane = anchorPoint.subtract(poly.pathOffset).transform(poly.calcOwnMatrix()),
25011
25042
  actionPerformed = fn(eventData, _objectSpread2(_objectSpread2({}, transform), {}, {
25012
25043
  pointIndex
25013
25044
  }), x, y),
25014
- polygonBaseSize = getSize(poly),
25015
25045
  adjustFlip = new Point(poly.flipX ? -1 : 1, poly.flipY ? -1 : 1);
25016
- const newPosition = new Point(poly.points[anchorIndex].x, poly.points[anchorIndex].y).subtract(poly.pathOffset).divide(polygonBaseSize).multiply(adjustFlip);
25017
- poly.setPositionByOrigin(pointInParentPlane, newPosition.x + 0.5, newPosition.y + 0.5);
25046
+ const newPositionNormalized = anchorPoint.subtract(poly.pathOffset).divide(poly._getNonTransformedDimensions()).multiply(adjustFlip);
25047
+ poly.setPositionByOrigin(anchorPointInParentPlane, newPositionNormalized.x + 0.5, newPositionNormalized.y + 0.5);
25018
25048
  return actionPerformed;
25019
25049
  };
25020
25050
  };