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

(grafted from e1677e1a2ae3eb9ddc41033299072c6b97fb2f56)

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2016-06-28 09:15:48 +03:00
parent 82c5c048bf
commit 412ea278fe
3 changed files with 13 additions and 1 deletions

View File

@ -9,6 +9,7 @@
- [#501] Rename Window->Close Window to Window->Close pattern. - [#501] Rename Window->Close Window to Window->Close pattern.
- [#515] Seam allowance wrong way. - [#515] Seam allowance wrong way.
- [#494] Printing is not working. - [#494] Printing is not working.
- [#516] Valentina crashes when use "Point intersect line and axis" instrument.
# Version 0.4.4 April 12, 2016 # Version 0.4.4 April 12, 2016
- Updated measurement templates with all measurements. Added new template Aldrich/Women measurements. - Updated measurement templates with all measurements. Added new template Aldrich/Women measurements.

View File

@ -159,9 +159,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

@ -186,6 +186,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;