Merge branch 'main' into enhance/fitView

This commit is contained in:
peterkogo
2025-03-25 13:21:11 +01:00
23 changed files with 274 additions and 74 deletions
@@ -63,7 +63,8 @@
selectionKeyPressed,
selectionMode,
panActivationKeyPressed,
unselectNodesAndEdges
unselectNodesAndEdges,
connection,
} = useStore();
let container: HTMLDivElement;
@@ -80,7 +81,8 @@
function onClick(event: MouseEvent | TouchEvent) {
// We prevent click events when the user let go of the selectionKey during a selection
if (selectionInProgress) {
// We also prevent click events when a connection is in progress
if (selectionInProgress || $connection.inProgress) {
selectionInProgress = false;
return;
}
@@ -76,7 +76,12 @@
$: {
boundingRect =
$nodeLookup.size > 0 ? getBoundsOfRects(getInternalNodesBounds($nodeLookup), viewBB) : viewBB;
$nodeLookup.size > 0
? getBoundsOfRects(
getInternalNodesBounds($nodeLookup, { filter: (n) => !n.hidden }),
viewBB
)
: viewBB;
$nodes;
}