From a01490b4f4fb81774b2c8d586a7ac9a31dc56155 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 21 Jul 2019 10:35:32 +0300 Subject: [PATCH] Fix searching edge index for mirrored piece. --HG-- branch : develop --- src/libs/vlayout/vlayoutpiece.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index ba71b47e6..dec1c6e49 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -1361,9 +1361,14 @@ int VLayoutPiece::EdgeByPoint(const QVector &path, const QPointF &p1) c const QVector points = Map(path); for (int i=0; i < points.size(); i++) { - if (points.at(i) == p1) + if (VFuzzyComparePoints(points.at(i), p1)) { - return i+1; + int pos = i+1; + if (pos > points.size()) + { + pos = 1; + } + return pos; } } return 0; // Did not find edge