Fixed getting seam allowence points.

--HG--
branch : feature
This commit is contained in:
dismine 2015-01-16 21:35:50 +02:00
parent b04d1f92e7
commit 28b2f97aaa
2 changed files with 21 additions and 23 deletions

View file

@ -432,6 +432,18 @@ QVector<QPointF> VDetail::SeamAllowancePoints(const VContainer *data) const
break; 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; return pointsEkv;
} }
@ -455,20 +467,10 @@ QPainterPath VDetail::ContourPath(const VContainer *data) const
if (getSeamAllowance() == true) if (getSeamAllowance() == true)
{ {
QPainterPath ekv; QPainterPath ekv;
QVector<QPointF> p; ekv.moveTo(pointsEkv.at(0));
if (getClosed() == true) for (qint32 i = 1; i < pointsEkv.count(); ++i)
{ {
p = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(getWidth())); ekv.lineTo(pointsEkv.at(i));
}
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));
} }
path.addPath(ekv); path.addPath(ekv);

View file

@ -367,22 +367,18 @@ QPainterPath VLayoutDetail::ContourPath() const
// seam allowence // seam allowence
if (getSeamAllowance() == true) if (getSeamAllowance() == true)
{ {
QPainterPath ekv;
QVector<QPointF> p;
points = Map(d->seamAllowence); points = Map(d->seamAllowence);
if (getClosed() == true) if (getClosed() == true)
{ {
p = Equidistant(points, EquidistantType::CloseEquidistant, getWidth()); points.append(points.at(0));
}
else
{
p = Equidistant(points, EquidistantType::OpenEquidistant, getWidth());
} }
ekv.moveTo(p.at(0)); QPainterPath ekv;
for (qint32 i = 1; i < p.count(); ++i) 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); path.addPath(ekv);