feat(svelte): add autoScale for node resizer

This commit is contained in:
moklick
2025-06-11 10:48:49 +02:00
parent 120a12baf4
commit 49e8c9329a
4 changed files with 16 additions and 3 deletions
@@ -22,6 +22,7 @@
maxWidth = Number.MAX_VALUE,
maxHeight = Number.MAX_VALUE,
keepAspectRatio = false,
autoScale = true,
shouldResize,
onResizeStart,
onResize,
@@ -121,7 +122,7 @@
bind:this={resizeControlRef}
style:border-color={isLineVariant ? color : undefined}
style:background-color={isLineVariant ? undefined : color}
style:scale={isLineVariant ? undefined : Math.max(1 / store.viewport.zoom, 1)}
style:scale={isLineVariant || !autoScale ? undefined : Math.max(1 / store.viewport.zoom, 1)}
{...rest}
>
{@render children?.()}