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