열이동, 단이동 시 스냅샷 저장 위치 수정
This commit is contained in:
parent
9a24860b1c
commit
39f4b0130f
@ -8,8 +8,6 @@ import { canvasState } from '@/store/canvasAtom'
|
||||
import { POLYGON_TYPE } from '@/common/common'
|
||||
import { useModule } from '@/hooks/module/useModule'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
import { useUndoRedo } from '@/hooks/useUndoRedo'
|
||||
|
||||
export const PANEL_EDIT_TYPE = {
|
||||
MOVE: 'move',
|
||||
MOVE_ALL: 'moveAll',
|
||||
@ -31,7 +29,6 @@ export default function PanelEdit(props) {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const { swalFire } = useSwal()
|
||||
const { moduleMove, moduleCopy, moduleMultiMove, moduleMultiCopy, moduleMoveAll, moduleCopyAll } = useModule()
|
||||
const { saveSnapshot } = useUndoRedo()
|
||||
useEffect(() => {
|
||||
if (!canvas) {
|
||||
const isSetupModules = canvas.getObjects().filter((obj) => obj.name === 'module') // selectedObj에 없는 객체만 필터링
|
||||
@ -54,7 +51,6 @@ export default function PanelEdit(props) {
|
||||
|
||||
//모듈 이동 적용
|
||||
const handleApply = () => {
|
||||
saveSnapshot()
|
||||
if (length <= 0) {
|
||||
swalFire({
|
||||
title: getMessage('common.message.please.input.over', [1]),
|
||||
|
||||
@ -277,6 +277,7 @@ export function useModule() {
|
||||
}
|
||||
|
||||
const moduleCopyAll = (length, direction, surfaceArray) => {
|
||||
saveSnapshot()
|
||||
surfaceArray.forEach((surface) => {
|
||||
const modules = canvas
|
||||
.getObjects()
|
||||
@ -332,6 +333,7 @@ export function useModule() {
|
||||
|
||||
const moduleCopy = (length, direction) => {
|
||||
if (canvas.getActiveObjects().length === 0) return
|
||||
saveSnapshot()
|
||||
const activeModuleIds = canvas.getActiveObjects().map((obj) => obj.id)
|
||||
const modules = canvas.getObjects().filter((obj) => activeModuleIds.includes(obj.id))
|
||||
const objects = getObjects()
|
||||
@ -404,6 +406,7 @@ export function useModule() {
|
||||
|
||||
removeTrestleMaterials()
|
||||
}
|
||||
saveSnapshot()
|
||||
const modules = type === 'row' ? getRowModules(activeModule) : getColumnModules(activeModule)
|
||||
const otherModules = canvas.getObjects().filter((obj) => obj.surfaceId === modules[0].surfaceId && obj.name === POLYGON_TYPE.MODULE)
|
||||
const objects = getObjects()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user