diff --git a/src/components/Roof2.jsx b/src/components/Roof2.jsx index 270e4fda..9e8f55ff 100644 --- a/src/components/Roof2.jsx +++ b/src/components/Roof2.jsx @@ -151,12 +151,12 @@ export default function Roof2() { ] const type3 = [ - { x: 100, y: 50 }, - { x: 100, y: 650 }, + { x: 200, y: 150 }, + { x: 200, y: 650 }, { x: 450, y: 650 }, - { x: 450, y: 400 }, - { x: 700, y: 400 }, - { x: 700, y: 50 }, + { x: 450, y: 500 }, + { x: 650, y: 500 }, + { x: 650, y: 150 }, ] const type4 = [ @@ -169,7 +169,7 @@ export default function Roof2() { ] if (canvas) { const polygon = new QPolygon( - type2, + type3, { fill: 'transparent', stroke: 'black', diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index 2f1842ed..7fbe9d4a 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -616,7 +616,7 @@ export default class QPolygon extends fabric.Group { y: (lines[1].y1 + lines[1].y2) / 2, } - ridgeLength = Math.min(this.lines[0].length, this.lines[3].length) + ridgeLength = Math.min(this.lines[2].length, this.lines[3].length) ridgePoint1 = [vPoint1.x, vPoint1.y, vPoint1.x, vPoint1.y - ridgeLength] ridgePoint2 = [vPoint2.x, vPoint2.y, vPoint2.x - ridgeLength, vPoint2.y] } else if (type === 4) {