reafactor(react/svelte): rename some util functions #3528
This commit is contained in:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user