From 93901f6a15cb21a1cec33bae4621e5e1661dfddf Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 21 Jul 2019 10:34:32 +0300 Subject: [PATCH] Fix getting edge for mirrored piece. --HG-- branch : develop --- src/libs/vlayout/vlayoutpiece.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index edf8eef5b..ba71b47e6 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -1317,7 +1317,7 @@ void VLayoutPiece::SetMirror(bool value) //--------------------------------------------------------------------------------------------------------------------- QLineF VLayoutPiece::Edge(const QVector &path, int i) const { - if (i < 1 || i > path.count()) + if (i < 1) { // Doesn't exist such edge return QLineF(); } @@ -1336,11 +1336,8 @@ QLineF VLayoutPiece::Edge(const QVector &path, int i) const if (d->mirror) { - const int oldI1 = i1; - const int size = path.size()-1; //-V807 - i1 = size - i2; - i2 = size - oldI1; - return QLineF(d->matrix.map(path.at(i2)), d->matrix.map(path.at(i1))); + QVector newPath = Map(path); + return QLineF(newPath.at(i1), newPath.at(i2)); } else {