지붕재 오류 수정

This commit is contained in:
hyojun.choi 2025-02-07 11:53:43 +09:00
parent 0030c665c1
commit 614aec95b7
3 changed files with 13 additions and 8 deletions

View File

@ -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]

View File

@ -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 {

View File

@ -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