Skip to content

Commit

Permalink
fix: rzScale (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
xieziyu authored May 20, 2023
1 parent 504703e commit 4d64479
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Well you can use both directives concurrently if you wish:
| rzMinHeight | number | 1 | The minimum height the resizable should be allowed to resize to. |
| rzMaxHeight | number | 1 | The maximum height the resizable should be allowed to resize to. |
| preventDefaultEvent | boolean | `false` | Whether to prevent default mouse event. |
| rzScale | number | 1 | Set it when parent element has CSS transform scale |

## CSS:
+ When `ngDraggable` is enabled on some element, `ng-draggable` and `ng-dragging` class is automatically toggled on it. You can use it to customize the pointer style. For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class AngularResizableDirective implements OnInit, OnChanges, OnDestroy,
@Input() rzMaxHeight: number = null;

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

/** Whether to prevent default event */
@Input() preventDefaultEvent = true;
Expand Down Expand Up @@ -475,7 +475,7 @@ export class AngularResizableDirective implements OnInit, OnChanges, OnDestroy,
}

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

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 4d64479

Please sign in to comment.