object 수정 시 uuid 변경
This commit is contained in:
parent
0de81807bd
commit
a95b7ebe4c
@ -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)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user