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
|
||||
|
||||
let nodeBounds: GraphNode[] = []
|
||||
if (options.nodes) {
|
||||
nodeBounds = nodes.filter((n) => options.nodes?.includes(n.id))
|
||||
}
|
||||
let nodeBounds: GraphNode[] = options.includeHiddenNodes ? nodes.filter((n) => n.width && n.height) : getNodes
|
||||
|
||||
if (!nodeBounds || !nodeBounds.length) {
|
||||
nodeBounds = options.includeHiddenNodes ? nodeBounds : getNodes
|
||||
if (options.nodes) {
|
||||
nodeBounds = nodeBounds.filter((n) => options.nodes?.includes(n.id))
|
||||
}
|
||||
|
||||
const bounds = getRectOfNodes(nodeBounds)
|
||||
|
||||
Reference in New Issue
Block a user