dev #930

Merged
ysCha merged 95 commits from dev into dev-deploy 2026-06-23 18:00:25 +09:00
Showing only changes of commit 632221ac01 - Show all commits

View File

@ -42,7 +42,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
const { getIntersectMousePoint } = useMouse()
const { checkModuleDisjointSurface } = useTurf()
const currentObject = useRecoilValue(currentObjectState)
const { saveSnapshot } = useUndoRedo()
const { saveSnapshot, popLastSnapshot } = useUndoRedo()
useEffect(() => {
if (canvas) {
@ -1604,6 +1604,9 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
}
const dormerOffset = (arrow1, arrow2, length1, length2) => {
// [undo fix] 도머 이동 전 상태를 스냅샷으로 저장해야 undo 시 도머가 원위치로 복원된다.
// (이동 후 저장하면 undo 해도 도머는 그 자리에 남는다.) 검증 실패 시 popLastSnapshot 으로 제거.
saveSnapshot()
length1 = parseInt(length1) / 10
length2 = parseInt(length2) / 10
@ -1657,13 +1660,11 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
dormer.top = top
dormer.setCoords()
// [undo 중복 fix] 검증 실패(원복) 시 위에서 저장한 스냅샷을 제거해 불필요한 undo 단계를 막는다.
popLastSnapshot()
return
}
// [undo 중복 fix] 검증 통과 후에만 스냅샷을 저장한다. 검증 실패(원복) 시에도 스냅샷이
// 쌓이면 도머 작업 undo 횟수가 불필요하게 늘어난다.
saveSnapshot()
if (dormer.type === 'group') {
dormer.set({ groupPoints: currentPoints })
const newDormer = reGroupObject(dormer)