📌fix: 배치면 삭제할 경우 이미지 있을때만 이미지 삭제 로직 통과하게 수정

This commit is contained in:
yoosangwook 2025-02-20 18:03:46 +09:00
parent 75e1f19aec
commit 76725cef94

View File

@ -734,28 +734,30 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
confirmFn: () => { confirmFn: () => {
canvas.clear() canvas.clear()
fabric.Image.fromURL(`${backgroundImage.path}`, function (img) { if (backgroundImage) {
console.log('🚀 ~ img:', img) fabric.Image.fromURL(`${backgroundImage.path}`, function (img) {
img.set({ console.log('🚀 ~ img:', img)
left: 0, img.set({
top: 0, left: 0,
width: img.width, top: 0,
height: img.height, width: img.width,
name: 'backGroundImage', height: img.height,
selectable: false, name: 'backGroundImage',
hasRotatingPoint: false, // 회전 핸들 활성화 selectable: false,
lockMovementX: false, hasRotatingPoint: false, // 회전 핸들 활성화
lockMovementY: false, lockMovementX: false,
lockRotation: false, lockMovementY: false,
lockScalingX: false, lockRotation: false,
lockScalingY: false, lockScalingX: false,
lockScalingY: false,
})
// image = img
canvas?.add(img)
canvas?.sendToBack(img)
canvas?.renderAll()
// setBackImg(img)
}) })
// image = img }
canvas?.add(img)
canvas?.sendToBack(img)
canvas?.renderAll()
// setBackImg(img)
})
resetOuterLinePoints() resetOuterLinePoints()
resetPlacementShapeDrawingPoints() resetPlacementShapeDrawingPoints()