Cutting too long an acute angle.

--HG--
branch : feature
This commit is contained in:
dismine 2014-12-17 12:02:45 +02:00
parent 8fac8f87ae
commit fa9a1d7807

View File

@ -375,15 +375,22 @@ QVector<QPointF> VEquidistant::EkvPoint(const QLineF &line1, const QLineF &line2
case (QLineF::UnboundedIntersection): case (QLineF::UnboundedIntersection):
{ {
QLineF line( line1.p2(), CrosPoint ); QLineF line( line1.p2(), CrosPoint );
if (line.length() > width + qApp->toPixel(8)) const qreal length = line.length();
{ if (length > width*2.4)
QLineF lineL = QLineF(bigLine1.p2(), CrosPoint); { // Cutting too long an acute angle
lineL.setLength(width); line.setLength(width); // Not sure about width value here
points.append(lineL.p2()); QLineF cutLine(line.p2(), CrosPoint); // Cut line is a perpendicular
cutLine.setLength(length); // Decided take this length
lineL = QLineF(bigLine2.p1(), CrosPoint); // We do not check intersection type because intersection must alwayse exist
lineL.setLength(width); QPointF px;
points.append(lineL.p2()); cutLine.setAngle(cutLine.angle()+90);
bigLine1.intersect( cutLine, &px );
points.append(px);
cutLine.setAngle(cutLine.angle()-180);
bigLine2.intersect( cutLine, &px );
points.append(px);
} }
else else
{ {