- BackGround Image show/hide 기능 추가
This commit is contained in:
parent
a60de83961
commit
094ac464bf
@ -939,7 +939,7 @@ export function useCanvasSetting() {
|
||||
optionName = ['rack', 'smartRack', 'bracket', 'eaveBar', 'halfEaveBar']
|
||||
break
|
||||
case 'imageDisplay':
|
||||
optionName = ['9']
|
||||
optionName = ['backGroundImage']
|
||||
break
|
||||
case 'totalDisplay':
|
||||
/**
|
||||
|
||||
@ -3,7 +3,7 @@ import { fabric } from 'fabric'
|
||||
|
||||
import { actionHandler, anchorWrapper, polygonPositionHandler } from '@/util/canvas-util'
|
||||
|
||||
import { useRecoilState } from 'recoil'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import { canvasSizeState, canvasState, fontSizeState } from '@/store/canvasAtom'
|
||||
import { QLine } from '@/components/fabric/QLine'
|
||||
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||
@ -15,6 +15,7 @@ import { useAxios } from '@/hooks/useAxios'
|
||||
import { useFont } from '@/hooks/common/useFont'
|
||||
import { OBJECT_PROTOTYPE, POLYGON_TYPE, RELOAD_TYPE_PROTOTYPE, SAVE_KEY } from '@/common/common'
|
||||
import { usePlan } from './usePlan'
|
||||
import { imageDisplaySelector } from '@/store/settingAtom'
|
||||
|
||||
export function useCanvas(id) {
|
||||
const [canvas, setCanvas] = useRecoilState(canvasState)
|
||||
@ -24,6 +25,7 @@ export function useCanvas(id) {
|
||||
const [canvasSize] = useRecoilState(canvasSizeState)
|
||||
const [fontSize] = useRecoilState(fontSizeState)
|
||||
const { setCanvasForEvent, attachDefaultEventOnCanvas } = useCanvasEvent()
|
||||
const isImageDisplay = useRecoilValue(imageDisplaySelector)
|
||||
const {} = useFont()
|
||||
|
||||
/**
|
||||
@ -530,6 +532,7 @@ export function useCanvas(id) {
|
||||
lockRotation: false,
|
||||
lockScalingX: false,
|
||||
lockScalingY: false,
|
||||
visible: isImageDisplay,
|
||||
})
|
||||
// image = img
|
||||
canvas?.add(img)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user