Fix regression.
This commit is contained in:
parent
d01b3ef45e
commit
e48298ce64
|
@ -454,15 +454,8 @@ void VGObject::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c
|
||||||
*/
|
*/
|
||||||
bool VGObject::IsPointOnLineSegment(const QPointF &t, const QPointF &p1, const QPointF &p2)
|
bool VGObject::IsPointOnLineSegment(const QPointF &t, const QPointF &p1, const QPointF &p2)
|
||||||
{
|
{
|
||||||
// Round points. 1 mm now more than 3 pixels (96 dpi). So, no big reasons to work with float values.
|
|
||||||
// See bug issue #458 Issue with segment of curve.
|
|
||||||
// https://bitbucket.org/dismine/valentina/issues/458/issue-with-segment-of-curve
|
|
||||||
const QPoint tR = t.toPoint();
|
|
||||||
const QPoint p1R = p1.toPoint();
|
|
||||||
const QPoint p2R = p2.toPoint();
|
|
||||||
|
|
||||||
// The test point must lie inside the bounding box spanned by the two line points.
|
// The test point must lie inside the bounding box spanned by the two line points.
|
||||||
if (not ( (p1R.x() <= tR.x() && tR.x() <= p2R.x()) || (p2R.x() <= tR.x() && tR.x() <= p1R.x()) ))
|
if (not ( (p1.x() <= t.x() && t.x() <= p2.x()) || (p2.x() <= t.x() && t.x() <= p1.x()) ))
|
||||||
{
|
{
|
||||||
if (not (qAbs(p1.x() - t.x()) <= accuracyPointOnLine) && not (qAbs(p2.x() - t.x()) <= accuracyPointOnLine))
|
if (not (qAbs(p1.x() - t.x()) <= accuracyPointOnLine) && not (qAbs(p2.x() - t.x()) <= accuracyPointOnLine))
|
||||||
{
|
{
|
||||||
|
@ -471,7 +464,7 @@ bool VGObject::IsPointOnLineSegment(const QPointF &t, const QPointF &p1, const Q
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not ( (p1R.y() <= tR.y() && tR.y() <= p2R.y()) || (p2R.y() <= tR.y() && tR.y() <= p1R.y()) ))
|
if (not ( (p1.y() <= t.y() && t.y() <= p2.y()) || (p2.y() <= t.y() && t.y() <= p1.y()) ))
|
||||||
{
|
{
|
||||||
if (not (qAbs(p1.y() - t.y()) <= accuracyPointOnLine) && not (qAbs(p2.y() - t.y()) <= accuracyPointOnLine))
|
if (not (qAbs(p1.y() - t.y()) <= accuracyPointOnLine) && not (qAbs(p2.y() - t.y()) <= accuracyPointOnLine))
|
||||||
{
|
{
|
||||||
|
@ -481,7 +474,7 @@ bool VGObject::IsPointOnLineSegment(const QPointF &t, const QPointF &p1, const Q
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test via the perp dot product (PDP)
|
// Test via the perp dot product (PDP)
|
||||||
return IsPointOnLineviaPDP(tR, p1R, p2R);
|
return IsPointOnLineviaPDP(t, p1, p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user