Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Nov 28, 2023
1 parent 82f86c6 commit 3dee2e3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/canvas/SelectableCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,10 @@ export class SelectableCanvas<EventSpec extends CanvasEvents = CanvasEvents>
? control.getActionHandler(e, target, control)?.bind(control)
: dragHandler,
action = getActionFromCorner(alreadySelected, corner, e, target),
origin = this._getOriginFromCorner(target, corner),
altKey = e[this.centeredKey as ModifierKey],
origin = this._shouldCenterTransform(target, action, altKey)
? ({ x: CENTER, y: CENTER } as const)
: this._getOriginFromCorner(target, corner),
/**
* relative to target's containing coordinate plane
* both agree on every point
Expand All @@ -632,19 +634,16 @@ export class SelectableCanvas<EventSpec extends CanvasEvents = CanvasEvents>
width: target.width,
height: target.height,
shiftKey: e.shiftKey,
altKey: altKey,
altKey,
original: {
...saveObjectTransform(target),
originX: origin.x,
originY: origin.y,
},
};

if (this._shouldCenterTransform(target, action, altKey)) {
transform.originX = CENTER;
transform.originY = CENTER;
}
this._currentTransform = transform;

this.fire('before:transform', {
e,
transform,
Expand Down

0 comments on commit 3dee2e3

Please sign in to comment.