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
|
@ -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();
|
||||||
|
|
|
@ -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