diff --git a/src/jmapNew/shape/Section/ELines.js b/src/jmapNew/shape/Section/ELines.js index 74c7cf603..df4c7b928 100644 --- a/src/jmapNew/shape/Section/ELines.js +++ b/src/jmapNew/shape/Section/ELines.js @@ -57,16 +57,17 @@ export default class ELines extends Group { const triangleB = new JTriangle(startPointB, endPointB); let lineDirect = 1; if (triangleA.getRotation() > 0) { lineDirect = -1; } else { lineDirect = 1; } - const new1Point1 = {x:startPointA.x - lineDirect * offset * triangleA.getSinRate(), y:startPointA.y - offset * triangleA.getCosRate()}; - const new1Point2 = {x:startPointA.x + lineDirect * offset * triangleA.getSinRate(), y:startPointA.y + offset * triangleA.getCosRate()}; - const new2Point1 = {x:endPointA.x - lineDirect * offset * triangleA.getSinRate(), y:endPointA.y - offset * triangleA.getCosRate()}; - const new2Point2 = {x:endPointA.x + lineDirect * offset * triangleA.getSinRate(), y:endPointA.y + offset * triangleA.getCosRate()}; + // - offset * triangleA.getCosRate() + const new1Point1 = {x:startPointA.x - lineDirect * offset / triangleA.getSinRate(), y:startPointA.y }; + const new1Point2 = {x:startPointA.x + lineDirect * offset / triangleA.getSinRate(), y:startPointA.y}; + const new2Point1 = {x:endPointA.x - lineDirect * offset / triangleA.getSinRate(), y:endPointA.y }; + const new2Point2 = {x:endPointA.x + lineDirect * offset / triangleA.getSinRate(), y:endPointA.y}; if (triangleB.getRotation() > 0) { lineDirect = -1; } else { lineDirect = 1; } - const new3Point1 = {x:startPointB.x + lineDirect * offset * triangleB.getSinRate(), y:startPointB.y + offset * triangleB.getCosRate()}; - const new3Point2 = {x:startPointB.x - lineDirect * offset * triangleB.getSinRate(), y:startPointB.y - offset * triangleB.getCosRate()}; - const new4Point1 = {x:endPointB.x + lineDirect * offset * triangleB.getSinRate(), y:endPointB.y + offset * triangleB.getCosRate()}; - const new4Point2 = {x:endPointB.x - lineDirect * offset * triangleB.getSinRate(), y:endPointB.y - offset * triangleB.getCosRate()}; + const new3Point1 = {x:startPointB.x + lineDirect * offset / triangleB.getSinRate(), y:startPointB.y}; + const new3Point2 = {x:startPointB.x - lineDirect * offset / triangleB.getSinRate(), y:startPointB.y}; + const new4Point1 = {x:endPointB.x + lineDirect * offset / triangleB.getSinRate(), y:endPointB.y}; + const new4Point2 = {x:endPointB.x - lineDirect * offset / triangleB.getSinRate(), y:endPointB.y}; // getCosRate // getSinRate const point1 = segmentsIntr(new1Point1, new2Point1, new3Point2, new4Point2);