diff --git a/src/common/common.js b/src/common/common.js index 2578e138..ef09b31d 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -180,6 +180,7 @@ export const SAVE_KEY = [ 'directionText', 'quotationParam', 'pcses', + 'roofMaterial', ] export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype] diff --git a/src/components/floor-plan/modal/setting01/FirstOption.jsx b/src/components/floor-plan/modal/setting01/FirstOption.jsx index fb383392..51a52cdb 100644 --- a/src/components/floor-plan/modal/setting01/FirstOption.jsx +++ b/src/components/floor-plan/modal/setting01/FirstOption.jsx @@ -44,7 +44,7 @@ export default function FirstOption(props) { const polygons = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) polygons.forEach((polygon) => { - setSurfaceShapePattern(polygon, item.column, false, polygon.roofMaterial, true) + setSurfaceShapePattern(polygon, item.column, false, polygon.roofMaterial, true, true) }) //디스플레이 설정 표시(단 건 선택) } else { diff --git a/src/hooks/common/useRoofFn.js b/src/hooks/common/useRoofFn.js index eaaebf0c..2b81ea05 100644 --- a/src/hooks/common/useRoofFn.js +++ b/src/hooks/common/useRoofFn.js @@ -20,19 +20,23 @@ export function useRoofFn() { const { addPitchText } = useLine() //면형상 선택 클릭시 지붕 패턴 입히기 - function setSurfaceShapePattern(polygon, mode = 'onlyBorder', trestleMode = false, roofMaterial = selectedRoofMaterial, isForceChange = false) { + function setSurfaceShapePattern( + polygon, + mode = 'onlyBorder', + trestleMode = false, + roofMaterial = selectedRoofMaterial, + isForceChange = false, + isDisplay = false, + ) { if (!polygon) { return } - if (isForceChange) { - if (polygon.roofMaterial) { + if (isForceChange && !isDisplay) { + /*if (polygon.roofMaterial) { polygon.roofMaterial = null - } + }*/ } - if (polygon.roofMaterial) { - return - } const ratio = window.devicePixelRatio || 1 const layout = roofMaterial.layout