feat(svelte): add node option 'origin'

This commit is contained in:
moklick
2023-03-14 13:20:52 +01:00
parent 653db49ea4
commit 154be3f900
7 changed files with 20 additions and 17 deletions
@@ -5,10 +5,10 @@
import { Selection } from '$lib/components/Selection';
import drag from '$lib/actions/drag';
const { selectionRectMode, nodes, nodeOrigin, transform, updateNodePositions } = useStore();
const { selectionRectMode, nodes, transform, updateNodePositions } = useStore();
$: selectedNodes = $nodes.filter((n) => n.selected);
$: rect = getRectOfNodes(selectedNodes, $nodeOrigin);
$: rect = getRectOfNodes(selectedNodes);
</script>
{#if selectedNodes && $selectionRectMode === 'nodes'}