From 013fd963b37454eb826b06716530fda8a2dda319 Mon Sep 17 00:00:00 2001 From: Jaeyoung Lee Date: Thu, 18 Dec 2025 11:27:56 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=80=EB=B3=84=EB=A1=9C=204=EA=B0=81?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=A7=88=EB=A3=A8=EC=84=A0=20=EA=B7=B8?= =?UTF-8?q?=EB=A0=A4=EC=A7=80=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/qpolygon-utils.js | 43 +++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/util/qpolygon-utils.js b/src/util/qpolygon-utils.js index 3a38edd8..f8c011f0 100644 --- a/src/util/qpolygon-utils.js +++ b/src/util/qpolygon-utils.js @@ -2957,11 +2957,12 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => { ridgePoint.x2 += pointVector.x * offset ridgePoint.y2 += pointVector.y * offset } - } else { - ridgePoint.x2 += pointVector.x * offset - ridgePoint.y2 += pointVector.y * offset } + } else { + ridgePoint.x2 += pointVector.x * offset + ridgePoint.y2 += pointVector.y * offset } + // } } else if (drivePoint) { ridgePoint.x2 = drivePoint.x ridgePoint.y2 = drivePoint.y @@ -3398,8 +3399,18 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => { default: break } - point[2] += pointVector.x * offset - point[3] += pointVector.y * offset + if (oppLine.attributes.type === LINE_TYPE.WALLLINE.EAVES) { + if (drivePoint) { + point[2] = drivePoint.x + point[3] = drivePoint.y + } else { + point[2] += pointVector.x * offset + point[3] += pointVector.y * offset + } + } else { + point[2] += pointVector.x * offset + point[3] += pointVector.y * offset + } } else if (drivePoint) { point[2] = drivePoint.x point[3] = drivePoint.y @@ -4316,8 +4327,8 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => { const intersect = lineIntersection(currLine.start, currLine.end, nextLine.start, nextLine.end, canvas) if (intersect) { - const checkCircle = new fabric.Circle({ left: intersect.x, top: intersect.y, radius: 5, fill: 'blue', parentId: roofId, name: 'check' }) - canvas.add(checkCircle).renderAll() + /*const checkCircle = new fabric.Circle({ left: intersect.x, top: intersect.y, radius: 5, fill: 'blue', parentId: roofId, name: 'check' }) + canvas.add(checkCircle).renderAll()*/ let distance1 = Math.sqrt(Math.pow(intersect.x - currLine.start.x, 2) + Math.pow(intersect.y - currLine.start.y, 2)) let distance2 = Math.sqrt(Math.pow(intersect.x - nextLine.start.x, 2) + Math.pow(intersect.y - nextLine.start.y, 2)) let point = [currLine.start.x, currLine.start.y, intersect.x, intersect.y] @@ -4799,13 +4810,17 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => { allLinesPoints.filter((p) => almostEqual(p.x, line.start.x) && almostEqual(p.y, line.start.y)).length < 3 && allLinesPoints.filter((p) => almostEqual(p.x, line.end.x) && almostEqual(p.y, line.end.y)).length === 0 ) { - if (startOnLine && endOnLine) { - if (line.degree === 0) { - innerLines.push(drawRoofLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode)) - } else { - innerLines.push( - drawHipLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode, null, line.degree, line.degree), - ) + if (line.type === TYPES.RIDGE && baseLines.length === 4 && (startOnLine || endOnLine)) { + innerLines.push(drawRidgeLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode)) + } else { + if (startOnLine && endOnLine) { + if (line.degree === 0) { + innerLines.push(drawRoofLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode)) + } else { + innerLines.push( + drawHipLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode, null, line.degree, line.degree), + ) + } } } }