From 366519781b4b3fd3fd776b898f0690a4fdf8d215 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 19 Jan 2015 20:01:42 +0200 Subject: [PATCH] Fix for method InsideContour. --HG-- branch : feature --- src/libs/vlayout/vlayoutpaper.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 23dae8cbf..6838f972d 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -600,28 +600,25 @@ VLayoutPaper::InsideType VLayoutPaper::InsideContour(const VLayoutDetail &detail const QVector p = Triplet(detailEdge); for (int n=0; nglobalContour.at(i).y(); + const qreal yj = d->globalContour.at(j).y(); - for (int i=0; i= p.at(n).y()) || (yj < p.at(n).y() && yi >= p.at(n).y()))) { - const qreal yi = d->globalContour.at(i).y(); - const qreal yj = d->globalContour.at(j).y(); - - if (((yi < p.at(n).y() && yj >= p.at(n).y()) || (yj < p.at(n).y() && yi >= p.at(n).y()))) - { - oddNodes ^= (p.at(n).y() * multiple.at(i) + constant.at(i) < p.at(n).x()); - } - - j=i; + oddNodes ^= (p.at(n).y() * multiple.at(i) + constant.at(i) < p.at(n).x()); } - if (oddNodes) - { - return InsideType::Inside; - } + j=i; + } + + if (oddNodes) + { + return InsideType::Inside; } } }