diff --git a/projects/angular2-draggable/src/lib/angular-resizable.directive.ts b/projects/angular2-draggable/src/lib/angular-resizable.directive.ts index 22f2116..aa7cb47 100644 --- a/projects/angular2-draggable/src/lib/angular-resizable.directive.ts +++ b/projects/angular2-draggable/src/lib/angular-resizable.directive.ts @@ -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; @@ -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;