diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index c04bb3ce..2df04fdc 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -5,7 +5,7 @@ import { moduleSelectionDataState } from '@/store/selectedModuleOptions' import { getDegreeByChon } from '@/util/canvas-util' import { v4 as uuidv4 } from 'uuid' import { useMasterController } from '@/hooks/common/useMasterController' -import { basicSettingState } from '@/store/settingAtom' +import { basicSettingState, trestleDisplaySelector } from '@/store/settingAtom' import { useSwal } from '@/hooks/useSwal' // 회로 및 가대설정 @@ -15,6 +15,7 @@ export const useTrestle = () => { const { getQuotationItem } = useMasterController() const currentAngleType = useRecoilValue(currentAngleTypeSelector) const roofSizeSet = useRecoilValue(basicSettingState).roofSizeSet + const isTrestleDisplay = useRecoilValue(trestleDisplaySelector) const { swalFire } = useSwal() const apply = () => { try { @@ -135,6 +136,7 @@ export const useTrestle = () => { selectable: false, surfaceId: surface.id, parentId: module.id, + visible: isTrestleDisplay, }) canvas.add(eaveBar) canvas.renderAll() @@ -165,6 +167,7 @@ export const useTrestle = () => { selectable: false, surfaceId: surface.id, parentId: module.id, + visible: isTrestleDisplay, }) canvas.add(halfEaveBar) canvas.renderAll() @@ -193,6 +196,7 @@ export const useTrestle = () => { strokeWidth: 4, selectable: false, parentId: module.id, + visible: isTrestleDisplay, }) canvas.add(halfEaveBar) canvas.renderAll() @@ -918,7 +922,7 @@ export const useTrestle = () => { offsetX: 0, offsetY: 0, }, - + visible: isTrestleDisplay, parentId: module.id, surfaceId: surface.id, supFitQty, @@ -952,6 +956,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen, @@ -992,6 +997,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen: rackLength, @@ -1022,6 +1028,7 @@ export const useTrestle = () => { surfaceId: surface.id, strokeWidth: 4, selectable: false, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen, @@ -1062,6 +1069,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen: rackLength, @@ -1090,6 +1098,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, strokeWidth: 4, selectable: false, supFitQty, @@ -1130,6 +1139,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen, @@ -1158,6 +1168,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, strokeWidth: 4, selectable: false, supFitQty, @@ -1209,6 +1220,7 @@ export const useTrestle = () => { fill: 'green', name: 'bracket', parentId: rack.parentId, + visible: isTrestleDisplay, surfaceId: surface.id, width: bracketLength, height: bracketLength, @@ -1228,6 +1240,7 @@ export const useTrestle = () => { fill: 'green', name: 'bracket', parentId: rack.parentId, + visible: isTrestleDisplay, surfaceId: surface.id, width: bracketLength, height: bracketLength, @@ -1246,6 +1259,7 @@ export const useTrestle = () => { top: y2 - bracketLength / 3, fill: 'green', parentId: rack.parentId, + visible: isTrestleDisplay, surfaceId: surface.id, name: 'bracket', width: bracketLength, @@ -1266,6 +1280,7 @@ export const useTrestle = () => { fill: 'green', name: 'bracket', parentId: rack.parentId, + visible: isTrestleDisplay, surfaceId: surface.id, width: bracketLength, height: bracketLength, @@ -1431,6 +1446,7 @@ export const useTrestle = () => { width: 10, height: 10, selectable: false, + visible: isTrestleDisplay, }) canvas.add(bracket) canvas.renderAll()