@internal constrain the size to the set min/max values
(oWidth: number, oHeight: number, moveLeft: boolean, moveUp: boolean)
| 310 | |
| 311 | /** @internal constrain the size to the set min/max values */ |
| 312 | protected _constrainSize(oWidth: number, oHeight: number, moveLeft: boolean, moveUp: boolean): Size { |
| 313 | const o = this.option; |
| 314 | const maxWidth = (moveLeft ? o.maxWidthMoveLeft : o.maxWidth) || Number.MAX_SAFE_INTEGER; |
| 315 | const minWidth = o.minWidth / this.rectScale.x || oWidth; |
| 316 | const maxHeight = (moveUp ? o.maxHeightMoveUp : o.maxHeight) || Number.MAX_SAFE_INTEGER; |
| 317 | const minHeight = o.minHeight / this.rectScale.y || oHeight; |
| 318 | const width = Math.min(maxWidth, Math.max(minWidth, oWidth)); |
| 319 | const height = Math.min(maxHeight, Math.max(minHeight, oHeight)); |
| 320 | return { width, height }; |
| 321 | } |
| 322 | |
| 323 | /** @internal */ |
| 324 | protected _applyChange(): DDResizable { |