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

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

View File

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