From 49aef1ec88aa64662aa3772601e196e04b08db82 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 7 Feb 2023 13:18:28 +0100 Subject: [PATCH] refactor(node-resizer): apply min width and height with aspect ratio Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- packages/node-resizer/src/ResizeControl.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/node-resizer/src/ResizeControl.vue b/packages/node-resizer/src/ResizeControl.vue index ddb069df..3d68c3ea 100644 --- a/packages/node-resizer/src/ResizeControl.vue +++ b/packages/node-resizer/src/ResizeControl.vue @@ -42,7 +42,7 @@ const aspectRatio = computed(() => { if (props.keepAspectRatio === true && startValues.value.width && startValues.value.height) { return startValues.value.width / startValues.value.height } - + if (typeof props.keepAspectRatio == 'number') { return props.keepAspectRatio } @@ -115,9 +115,9 @@ watchEffect((onCleanup) => { const newHeight = width / aspectRatio.value if (distX > distY) { - height = newHeight + height = Math.max(newHeight, props.minHeight) } else { - width = newWidth + width = Math.max(newWidth, props.minWidth) } } }