diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index db44dfb50..5d7c38ea2 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -56,11 +56,20 @@ const qreal VSAPoint::maxPassmarkLength = (10/*mm*/ / 25.4) * PrintDPI; namespace { +//--------------------------------------------------------------------------------------------------------------------- +inline bool IsSameDirection(QPointF p1, QPointF p2, QPointF px) +{ + return qAbs(QLineF(p1, p2).angle() - QLineF(p1, px).angle()) < 0.001; +} + //--------------------------------------------------------------------------------------------------------------------- // Do we create a point outside of a path? inline bool IsOutsidePoint(QPointF p1, QPointF p2, QPointF px) { - return qAbs(QLineF(p1, p2).angle() - QLineF(p1, px).angle()) < 0.001; + QLineF seg1(p1, p2); + QLineF seg2(p1, px); + + return IsSameDirection(p1, p2, px) && seg2.length() >= seg1.length(); } //---------------------------------------------------------------------------------------------------------------------