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.
- [#515] Seam allowance wrong way.
- [#494] Printing is not working.
- [#516] Valentina crashes when use "Point intersect line and axis" instrument.
# Version 0.4.4 April 12, 2016
- Updated measurement templates with all measurements. Added new template Aldrich/Women measurements.

View File

@ -160,7 +160,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

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