@tldraw/editor 5.6.0-canary.ff4411b6d84d → 5.6.0-next.133b55acee83

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/dist-cjs/index.js CHANGED
@@ -392,7 +392,7 @@ var import_uniq = require("./lib/utils/uniq");
392
392
  var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
393
393
  (0, import_utils.registerTldrawLibraryVersion)(
394
394
  "@tldraw/editor",
395
- "5.6.0-canary.ff4411b6d84d",
395
+ "5.6.0-next.133b55acee83",
396
396
  "cjs"
397
397
  );
398
398
  //# sourceMappingURL=index.js.map
@@ -5928,9 +5928,10 @@ class Editor extends import_eventemitter3.default {
5928
5928
  }
5929
5929
  }
5930
5930
  let workingShape = null;
5931
+ const initialPagePoint = import_Mat.Mat.applyToPoint(pageTransform, new import_Vec.Vec());
5931
5932
  if (util.onResize && util.canResize(initialShape)) {
5932
5933
  const newPagePoint = this._scalePagePoint(
5933
- import_Mat.Mat.applyToPoint(pageTransform, new import_Vec.Vec(0, 0)),
5934
+ initialPagePoint,
5934
5935
  scaleOrigin,
5935
5936
  scale,
5936
5937
  scaleAxisRotation
@@ -5943,7 +5944,6 @@ class Editor extends import_eventemitter3.default {
5943
5944
  );
5944
5945
  myScale.x = areWidthAndHeightAlignedWithCorrectAxis ? scale.x : scale.y;
5945
5946
  myScale.y = areWidthAndHeightAlignedWithCorrectAxis ? scale.y : scale.x;
5946
- const initialPagePoint = import_Mat.Mat.applyToPoint(pageTransform, new import_Vec.Vec());
5947
5947
  const { x, y } = this.getPointInParentSpace(initialShape.id, initialPagePoint);
5948
5948
  workingShape = initialShape;
5949
5949
  if (!opts.skipStartAndEndCallbacks) {
@@ -5989,24 +5989,26 @@ class Editor extends import_eventemitter3.default {
5989
5989
  scale,
5990
5990
  scaleAxisRotation
5991
5991
  );
5992
- const initialPageCenterInParentSpace = this.getPointInParentSpace(
5992
+ const repositionedPagePoint = import_Vec.Vec.Add(
5993
+ newPageCenter,
5994
+ import_Vec.Vec.Sub(initialPagePoint, initialPageCenter)
5995
+ );
5996
+ const repositionedLocalPoint = this.getPointInParentSpace(
5993
5997
  initialShape.id,
5994
- initialPageCenter
5998
+ repositionedPagePoint
5995
5999
  );
5996
- const newPageCenterInParentSpace = this.getPointInParentSpace(initialShape.id, newPageCenter);
5997
- const delta = import_Vec.Vec.Sub(newPageCenterInParentSpace, initialPageCenterInParentSpace);
5998
6000
  if (workingShape) {
5999
6001
  return {
6000
6002
  ...workingShape,
6001
- x: initialShape.x + delta.x,
6002
- y: initialShape.y + delta.y
6003
+ x: repositionedLocalPoint.x,
6004
+ y: repositionedLocalPoint.y
6003
6005
  };
6004
6006
  }
6005
6007
  return {
6006
6008
  id,
6007
6009
  type: initialShape.type,
6008
- x: initialShape.x + delta.x,
6009
- y: initialShape.y + delta.y
6010
+ x: repositionedLocalPoint.x,
6011
+ y: repositionedLocalPoint.y
6010
6012
  };
6011
6013
  }
6012
6014
  /** @internal */