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