feat(svelte) add fitViewOptions, closes #3440

This commit is contained in:
Peter
2023-09-25 12:58:04 +02:00
parent 339df4c651
commit ada5b94673
9 changed files with 71 additions and 44 deletions
+4 -3
View File
@@ -180,10 +180,11 @@ export function fitView<Params extends FitViewParamsBase<NodeBase>, Options exte
return isVisible;
});
const nodesInitialized = filteredNodes.every((n) => n.width && n.height);
console.log(filteredNodes);
if (nodes.length > 0 && nodesInitialized) {
const bounds = getRectOfNodes(nodes, nodeOrigin);
if (filteredNodes.length > 0) {
const bounds = getRectOfNodes(filteredNodes, nodeOrigin);
console.log(bounds);
const [x, y, zoom] = getTransformForBounds(
bounds,