Fix for method UniteWithContour.

--HG--
branch : feature
This commit is contained in:
dismine 2015-01-17 22:51:17 +02:00
parent 696aaa413b
commit c044b334d7

View File

@ -639,11 +639,20 @@ QVector<QPointF> VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int
return QVector<QPointF>(); return QVector<QPointF>();
} }
for(int i=0; i < d->globalContour.count(); ++i) int i2 = 0;
if (globalI == d->globalContour.count())
{ {
newContour.append(d->globalContour.at(i)); i2 = 0;
++i; }
if (i==globalI) else
{
i2 = globalI;
}
int i=0;
while(i < d->globalContour.count())
{
if (i == i2)
{ {
int processedEdges = 0; int processedEdges = 0;
const int nD = detail.EdgesCount(); const int nD = detail.EdgesCount();
@ -654,15 +663,31 @@ QVector<QPointF> VLayoutPaper::UniteWithContour(const VLayoutDetail &detail, int
{ {
j=1; j=1;
} }
const QVector<QPointF> points = CutEdge(detail.Edge(j)); if (j != detJ)
for (int i = 0; i < points.size()-1; ++i)
{ {
newContour.append(points.at(i)); const QVector<QPointF> points = CutEdge(detail.Edge(j));
for (int i = 0; i < points.size()-1; ++i)
{
newContour.append(points.at(i));
}
} }
++processedEdges; ++processedEdges;
++j; ++j;
}while (processedEdges <= nD); }while (processedEdges < nD);
} }
if (newContour.isEmpty() == false)
{
if (newContour.last() != d->globalContour.at(i))
{
newContour.append(d->globalContour.at(i));
}
}
else
{
newContour.append(d->globalContour.at(i));
}
++i;
} }
} }
return newContour; return newContour;