fix(label): selected path

This commit is contained in:
zhangheng
2026-04-17 14:08:10 +08:00
parent 8a99be55d1
commit 6c981d465b
3 changed files with 38 additions and 6 deletions

View File

@@ -1511,6 +1511,7 @@ const LabelPage = ({
const restoreDrawShortcutSnapshot = useCallback(() => {
useKeyboardStore.getState().setDrawAction("none")
useKeyboardStore.getState().setSelectedObjectEditTarget(null)
const snapshot = drawShortcutSnapshotRef.current
if (!snapshot) return
@@ -1562,6 +1563,7 @@ const LabelPage = ({
setActiveOperation(selectedContext.operationId)
usePaperStore.getState().setContinuePolygonTarget(null)
useKeyboardStore.getState().setSelectedObjectEditTarget(selectedContext)
setEditMode(true)
setDrawOption("default")
useKeyboardStore.getState().setDrawAction(mode)
@@ -1715,6 +1717,7 @@ const LabelPage = ({
setPressA(false)
setActiveOperation(selectedContext.operationId)
useKeyboardStore.getState().setDrawAction("none")
useKeyboardStore.getState().setSelectedObjectEditTarget(null)
usePaperStore.getState().setContinuePolygonTarget({
imageId: selectedContext.imageId,
operationId: selectedContext.operationId,
@@ -2367,6 +2370,7 @@ const LabelPage = ({
useEffect(() => {
useKeyboardStore.getState().setCopyDataIds([])
useKeyboardStore.getState().setDrawAction("none")
useKeyboardStore.getState().setSelectedObjectEditTarget(null)
usePaperStore.getState().setContinuePolygonTarget(null)
drawShortcutSnapshotRef.current = null
}, [activeImage])