From ec79f50e6560984bea07d668f92afc5376c38044 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 19 Sep 2018 12:24:24 +0300 Subject: [PATCH] Fix float point accuracy issue. ref #883. --HG-- branch : release --- src/libs/vlayout/vabstractpiece.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index f4c6b1b5a..ab92ed11b 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -41,11 +41,9 @@ const qreal maxL = 2.5; namespace { // Do we create a point outside of a path? -bool IsOutsidePoint(QPointF p1, QPointF p2, QPointF px) +inline bool IsOutsidePoint(QPointF p1, QPointF p2, QPointF px) { - QLineF line(p1, p2); - QLineF ext(p1, px); - return VFuzzyComparePossibleNulls(line.angle(), ext.angle()); + return qAbs(QLineF(p1, p2).angle() - QLineF(p1, px).angle()) < 0.001; } //---------------------------------------------------------------------------------------------------------------------