refactor(svelte): cleanup nodes selection

This commit is contained in:
moklick
2023-10-09 15:51:53 +02:00
parent 6f9ebbf609
commit a46104cf40
6 changed files with 33 additions and 13 deletions
@@ -1,15 +1,17 @@
<script lang="ts">
export let x: number | null = 0;
export let y: number | null = 0;
export let width: number | null = 0;
export let height: number | null = 0;
export let width: number | string | null = 0;
export let height: number | string | null = 0;
export let isVisible: boolean = true;
</script>
{#if isVisible}
<div
class="svelte-flow__selection"
style="width: {width}px; height: {height}px; transform: translate({x}px, {y}px)"
style:width={typeof width === 'string' ? width : `${width}px`}
style:height={typeof height === 'string' ? height : `${height}px`}
style:transform={`translate(${x}px, ${y}px)`}
/>
{/if}