[nit] Simplify selection overlay watcher (#3789)

This commit is contained in:
Chenlei Hu
2025-05-06 16:07:19 -04:00
committed by GitHub
parent 131fae72d4
commit 926278e9ef

View File

@@ -63,19 +63,13 @@ watch(
)
watch(
() => {
const canvas = canvasStore.canvas
if (!canvas) return null
return {
scale: canvas.ds.state.scale,
offset: [canvas.ds.state.offset[0], canvas.ds.state.offset[1]]
}
},
() => canvasStore.getCanvas().ds.state,
(state) => {
if (!state) return
positionSelectionOverlay(canvasStore.canvas as LGraphCanvas)
}
positionSelectionOverlay(canvasStore.getCanvas())
},
{ deep: true }
)
watch(