Fixed issue #516. Valentina crashes when use "Point intersect line and axis" instrument.

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2016-06-27 15:09:32 +03:00
parent 643fafcbc9
commit 289bf05642
2 changed files with 12 additions and 1 deletions

View File

@ -157,7 +157,14 @@ QPointF VToolLineIntersectAxis::FindPoint(const QLineF &axis, const QLineF &line
QLineF::IntersectType intersect = axis.intersect(line, &fPoint);
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{
return fPoint;
if(axis.angle() == line.angle() || qAbs(axis.angle() - line.angle()) == 180)
{
return QPointF();
}
else
{
return fPoint;
}
}
else
{

View File

@ -182,6 +182,10 @@ QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, c
{
return QPointF();
}
if (axis.angle() == hypotenuse.angle() || qAbs(axis.angle() - hypotenuse.angle()) == 180)
{
return QPointF();
}
qreal step = 1;