Fixed issue #516. Valentina crashes when use "Point intersect line and axis" instrument.
--HG-- branch : feature
This commit is contained in:
parent
643fafcbc9
commit
289bf05642
|
@ -157,7 +157,14 @@ QPointF VToolLineIntersectAxis::FindPoint(const QLineF &axis, const QLineF &line
|
||||||
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)
|
||||||
{
|
{
|
||||||
return fPoint;
|
if(axis.angle() == line.angle() || qAbs(axis.angle() - line.angle()) == 180)
|
||||||
|
{
|
||||||
|
return QPointF();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return fPoint;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user