From 28b2f97aaa2f342c60d3ffc3acd6030b3ac52f3c Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 16 Jan 2015 21:35:50 +0200 Subject: [PATCH] Fixed getting seam allowence points. --HG-- branch : feature --- src/app/geometry/vdetail.cpp | 28 +++++++++++++++------------- src/libs/vlayout/vlayoutdetail.cpp | 16 ++++++---------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index c1ce9a6fe..3112023ff 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -432,6 +432,18 @@ QVector VDetail::SeamAllowancePoints(const VContainer *data) const break; } } + + if (getSeamAllowance() == true) + { + if (getClosed() == true) + { + pointsEkv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(getWidth())); + } + else + { + pointsEkv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(getWidth())); + } + } return pointsEkv; } @@ -455,20 +467,10 @@ QPainterPath VDetail::ContourPath(const VContainer *data) const if (getSeamAllowance() == true) { QPainterPath ekv; - QVector p; - if (getClosed() == true) + ekv.moveTo(pointsEkv.at(0)); + for (qint32 i = 1; i < pointsEkv.count(); ++i) { - p = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(getWidth())); - } - else - { - p = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(getWidth())); - } - - ekv.moveTo(p.at(0)); - for (qint32 i = 1; i < p.count(); ++i) - { - ekv.lineTo(p.at(i)); + ekv.lineTo(pointsEkv.at(i)); } path.addPath(ekv); diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index a47144953..7255da1e2 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -367,22 +367,18 @@ QPainterPath VLayoutDetail::ContourPath() const // seam allowence if (getSeamAllowance() == true) { - QPainterPath ekv; - QVector p; points = Map(d->seamAllowence); + if (getClosed() == true) { - p = Equidistant(points, EquidistantType::CloseEquidistant, getWidth()); - } - else - { - p = Equidistant(points, EquidistantType::OpenEquidistant, getWidth()); + points.append(points.at(0)); } - ekv.moveTo(p.at(0)); - for (qint32 i = 1; i < p.count(); ++i) + QPainterPath ekv; + ekv.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) { - ekv.lineTo(p.at(i)); + ekv.lineTo(points.at(i)); } path.addPath(ekv);