Skip to content

Commit eb616ab

Browse files
perf: Canvas optimization
1 parent 1276ec8 commit eb616ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ui/src/workflow/index.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ const renderGraphData = (data?: any) => {
112112
})
113113
114114
setTimeout(() => {
115-
lf.value?.fitView()
115+
if (lf.value.graphModel?.nodes.length > 1) {
116+
lf.value?.fitView()
117+
} else {
118+
lf.value?.translateCenter()
119+
}
116120
}, 500)
117121
}
118122
}

0 commit comments

Comments
 (0)