From 0344c5a35f7c47b8fa3f9eb533a753f832af7486 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Sat, 6 Apr 2024 08:07:24 +0100 Subject: [PATCH] ok --- packages/editor/src/lib/editor/Editor.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/editor/src/lib/editor/Editor.ts b/packages/editor/src/lib/editor/Editor.ts index de51b4fd1..002862c87 100644 --- a/packages/editor/src/lib/editor/Editor.ts +++ b/packages/editor/src/lib/editor/Editor.ts @@ -6221,7 +6221,7 @@ export class Editor extends EventEmitter { * @public */ resizeShape(id: TLShapeId, scale: VecLike, options?: TLResizeShapeOptions): this { - this.updateShape(this.getResizedShape(id, scale, options)) + this.updateShape(this.getResizedShape(id, scale, options), { squashing: true }) return this } @@ -6293,14 +6293,12 @@ export class Editor extends EventEmitter { if (util.onResize && util.canResize(initialShape)) { // get the model changes from the shape util - const newPagePoint = this._scalePagePoint( - Mat.applyToPoint(pageTransform, new Vec(0, 0)), - scaleOrigin, - scale, - scaleAxisRotation - ) - const newLocalPoint = this.getPointInParentSpace(initialShape.id, newPagePoint) + // Get the point in the same coordinate space as the shape + const newLocalPoint = this.getPointInParentSpace( + initialShape.id, + this._scalePagePoint(pageTransform.point(), scaleOrigin, scale, scaleAxisRotation) + ) // resize the shape's local bounding box const myScale = new Vec(scale.x, scale.y)