redo undo 작업중
This commit is contained in:
parent
b7cf8eeca9
commit
b49e3871d5
@ -21,7 +21,7 @@ import { MENU } from '@/common/common'
|
|||||||
import { useTrestle } from '@/hooks/module/useTrestle'
|
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||||
import { useOrientation } from '@/hooks/module/useOrientation'
|
import { useOrientation } from '@/hooks/module/useOrientation'
|
||||||
import { corridorDimensionSelector } from '@/store/settingAtom'
|
import { corridorDimensionSelector } from '@/store/settingAtom'
|
||||||
import { useUndoRedo } from '@/hooks/useUndoRedo'
|
import { useUndoRedo, isUndoRedoRestoring } from '@/hooks/useUndoRedo'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 메뉴 처리 훅
|
* 메뉴 처리 훅
|
||||||
@ -69,6 +69,8 @@ export default function useMenu() {
|
|||||||
addPopup(popupId, 1, <RoofAllocationSetting id={popupId} />)
|
addPopup(popupId, 1, <RoofAllocationSetting id={popupId} />)
|
||||||
break
|
break
|
||||||
case MENU.ROOF_COVERING.ALL_REMOVE:
|
case MENU.ROOF_COVERING.ALL_REMOVE:
|
||||||
|
// undo/redo 복원 중에는 confirm 창을 띄우지 않는다
|
||||||
|
if (isUndoRedoRestoring()) break
|
||||||
deleteAllSurfacesAndObjects()
|
deleteAllSurfacesAndObjects()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -91,6 +93,8 @@ export default function useMenu() {
|
|||||||
addPopup(popupId, 1, <ObjectSetting id={popupId} />)
|
addPopup(popupId, 1, <ObjectSetting id={popupId} />)
|
||||||
break
|
break
|
||||||
case MENU.BATCH_CANVAS.ALL_REMOVE:
|
case MENU.BATCH_CANVAS.ALL_REMOVE:
|
||||||
|
// undo/redo 복원 중에는 confirm 창을 띄우지 않는다
|
||||||
|
if (isUndoRedoRestoring()) break
|
||||||
deleteAllSurfacesAndObjects()
|
deleteAllSurfacesAndObjects()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,13 @@ const MAX_HISTORY = 3
|
|||||||
let _isRestoring = false
|
let _isRestoring = false
|
||||||
let _restoreTimer = null
|
let _restoreTimer = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외부 훅/모듈에서 현재 undo/redo 복원 중인지 확인할 때 사용
|
||||||
|
*/
|
||||||
|
export function isUndoRedoRestoring() {
|
||||||
|
return _isRestoring
|
||||||
|
}
|
||||||
|
|
||||||
// loadFromJSON 공통 처리 - 이벤트 일시 중단 후 복원
|
// loadFromJSON 공통 처리 - 이벤트 일시 중단 후 복원
|
||||||
function _restoreFromJSON(canvas, snapshot, restoreAtomSnapshot, rebuildCanvasAtoms, setCanvasZoom) {
|
function _restoreFromJSON(canvas, snapshot, restoreAtomSnapshot, rebuildCanvasAtoms, setCanvasZoom) {
|
||||||
// 진행 중인 복원 타이머가 있으면 취소
|
// 진행 중인 복원 타이머가 있으면 취소
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user