Skip to content

Commit

Permalink
fix: resize with parent element scaled (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
airchen233 authored May 20, 2023
1 parent 1c27ca1 commit 504703e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ export class AngularResizableDirective implements OnInit, OnChanges, OnDestroy,
/** The maximum height the resizable should be allowed to resize to. */
@Input() rzMaxHeight: number = null;

/** Input css scale transform of element so translations are correct */
@Input() scale = 1;

/** Whether to prevent default event */
@Input() preventDefaultEvent = true;

Expand Down Expand Up @@ -472,7 +475,7 @@ export class AngularResizableDirective implements OnInit, OnChanges, OnDestroy,
}

private resizeTo(p: Position) {
p.subtract(this._origMousePos);
p.subtract(this._origMousePos).divide(this.scale);

const tmpX = Math.round(p.x / this._gridSize.x) * this._gridSize.x;
const tmpY = Math.round(p.y / this._gridSize.y) * this._gridSize.y;
Expand Down

0 comments on commit 504703e

Please sign in to comment.