Fixed issue #671. Weird behaviour of the passmark.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2017-04-27 16:37:10 +03:00
parent f990a5726c
commit 32e3a6340c

View File

@ -957,18 +957,15 @@ bool VAbstractPiece::IsEkvPointOnLine(const QPointF &iPoint, const QPointF &prev
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
bool VAbstractPiece::IsEkvPointOnLine(const VSAPoint &iPoint, const VSAPoint &prevPoint, const VSAPoint &nextPoint) bool VAbstractPiece::IsEkvPointOnLine(const VSAPoint &iPoint, const VSAPoint &prevPoint, const VSAPoint &nextPoint)
{ {
// See bug #646 // See bug #671
bool ekvPointOnLine = false; const qreal tmpWidth = 10;
const QLineF bigLine1 = ParallelLine(prevPoint, iPoint, tmpWidth );
const QLineF bigLine2 = ParallelLine(iPoint, nextPoint, tmpWidth );
if (VFuzzyComparePossibleNulls(prevPoint.GetSAAfter(), iPoint.GetSABefore()) return (VGObject::IsPointOnLineviaPDP(iPoint, prevPoint, nextPoint)
&& VFuzzyComparePossibleNulls(iPoint.GetSAAfter(), nextPoint.GetSABefore())) && VGObject::IsPointOnLineviaPDP(bigLine1.p2(), bigLine1.p1(), bigLine2.p2())
{ && VGObject::IsPointOnLineviaPDP(bigLine2.p1(), bigLine1.p1(), bigLine2.p2())
if (VFuzzyComparePossibleNulls(prevPoint.GetSAAfter(), nextPoint.GetSABefore())) && qAbs(prevPoint.GetSAAfter(tmpWidth) - nextPoint.GetSABefore(tmpWidth)) < VGObject::accuracyPointOnLine);
{
ekvPointOnLine = true;
}
}
return (VGObject::IsPointOnLineviaPDP(iPoint, prevPoint, nextPoint) && ekvPointOnLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------