reafactor(react/svelte): rename some util functions #3528

This commit is contained in:
moklick
2023-11-13 10:45:06 +01:00
parent b368b14b22
commit 90912a6c1a
19 changed files with 109 additions and 128 deletions
@@ -1,5 +1,5 @@
<script lang="ts">
import { getRectOfNodes } from '@xyflow/system';
import { getNodesBounds } from '@xyflow/system';
import { useStore } from '$lib/store';
import { Selection } from '$lib/components/Selection';
@@ -9,13 +9,13 @@
const { selectionRectMode, nodes } = store;
$: selectedNodes = $nodes.filter((n) => n.selected);
$: rect = getRectOfNodes(selectedNodes);
$: bounds = getNodesBounds(selectedNodes);
</script>
{#if selectedNodes && $selectionRectMode === 'nodes'}
<div
class="selection-wrapper nopan"
style="width: {rect.width}px; height: {rect.height}px; transform: translate({rect.x}px, {rect.y}px)"
style="width: {bounds.width}px; height: {bounds.height}px; transform: translate({bounds.x}px, {bounds.y}px)"
use:drag={{ disabled: false, store }}
>
<Selection width="100%" height="100%" x={0} y={0} />