fix(node-resizer): use autoscale prop to check if resize handle should scale (#2012)
* fix(node-resizer): use autoscale prop to check if resize handle should be scaled Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
5
.changeset/hot-bats-boil.md
Normal file
5
.changeset/hot-bats-boil.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@vue-flow/node-resizer": patch
|
||||
---
|
||||
|
||||
Use auto-scale prop to determine whether a resize handle should be scaled.
|
||||
@@ -45,6 +45,10 @@ const positionClassNames = computed(() => controlPosition.value.split('-'))
|
||||
|
||||
const controlStyle = toRef(() => (props.color ? { [StylingProperty[props.variant]]: props.color } : {}))
|
||||
|
||||
const isHandleControl = toRef(() => props.variant === ResizeControlVariant.Handle)
|
||||
|
||||
const scale = computed(() => (isHandleControl.value && props.autoScale ? `${Math.max(1 / viewport.value.zoom, 1)}` : undefined))
|
||||
|
||||
watchEffect((onCleanup) => {
|
||||
if (!resizeControlRef.value || !props.nodeId) {
|
||||
return
|
||||
@@ -243,7 +247,7 @@ export default {
|
||||
:class="[...positionClassNames, variant, noDragClassName]"
|
||||
:style="{
|
||||
...controlStyle,
|
||||
scale: variant === ResizeControlVariant.Handle ? `${Math.max(1 / viewport.zoom, 1)}` : undefined,
|
||||
scale,
|
||||
}"
|
||||
>
|
||||
<slot />
|
||||
|
||||
Reference in New Issue
Block a user