object 수정 시 uuid 변경

This commit is contained in:
hyojun.choi 2024-10-23 17:08:50 +09:00
parent 0de81807bd
commit a95b7ebe4c

View File

@ -1,5 +1,6 @@
import { useState } from 'react' import { useState } from 'react'
import { useRecoilState, useRecoilValue } from 'recoil' import { useRecoilState, useRecoilValue } from 'recoil'
import { v4 as uuidv4 } from 'uuid'
import { canvasSizeState, canvasState, canvasZoomState, currentObjectState, fontFamilyState, fontSizeState } from '@/store/canvasAtom' import { canvasSizeState, canvasState, canvasZoomState, currentObjectState, fontFamilyState, fontSizeState } from '@/store/canvasAtom'
import { QPolygon } from '@/components/fabric/QPolygon' import { QPolygon } from '@/components/fabric/QPolygon'
@ -32,7 +33,9 @@ export function useCanvasEvent() {
const objectEvent = { const objectEvent = {
onChange: (e) => { onChange: (e) => {
const target = e.target const target = e.target
if (target) { if (target) {
target.uuid = uuidv4()
// settleDown(target) // settleDown(target)
} }
}, },