fix(core): wait for viewport helper in fromObject action

This commit is contained in:
braks
2023-07-25 09:20:15 +02:00
committed by Braks
parent f28318e874
commit fd155e41af
+9 -1
View File
@@ -844,7 +844,15 @@ export function useActions(
}
if (position) {
viewportHelper.value.setTransform({ x: position[0], y: position[1], zoom: zoom || 1 })
until(() => viewportHelper.value.initialized)
.toBe(true)
.then(() => {
viewportHelper.value.setViewport({
x: position[0],
y: position[1],
zoom: zoom || state.viewport.zoom,
})
})
}
}