fix(core): exclude hidden nodes in fitView when includeHiddenNodes is false
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -107,13 +107,10 @@ export default (vueFlowId?: string): ViewportFunctions => {
|
|||||||
|
|
||||||
if (!getNodes.length) return
|
if (!getNodes.length) return
|
||||||
|
|
||||||
let nodeBounds: GraphNode[] = []
|
let nodeBounds: GraphNode[] = options.includeHiddenNodes ? nodes.filter((n) => n.width && n.height) : getNodes
|
||||||
if (options.nodes) {
|
|
||||||
nodeBounds = nodes.filter((n) => options.nodes?.includes(n.id))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!nodeBounds || !nodeBounds.length) {
|
if (options.nodes) {
|
||||||
nodeBounds = options.includeHiddenNodes ? nodeBounds : getNodes
|
nodeBounds = nodeBounds.filter((n) => options.nodes?.includes(n.id))
|
||||||
}
|
}
|
||||||
|
|
||||||
const bounds = getRectOfNodes(nodeBounds)
|
const bounds = getRectOfNodes(nodeBounds)
|
||||||
|
|||||||
Reference in New Issue
Block a user