Speed optimization.
--HG-- branch : feature
This commit is contained in:
parent
3c76f32bed
commit
120f4cf565
|
@ -190,17 +190,30 @@ QLineF VLayoutDetail::Edge(int i) const
|
|||
{ // Doesn't exist such edge
|
||||
return QLineF();
|
||||
}
|
||||
const QVector<QPointF> points = GetLayoutAllowencePoints();
|
||||
QLineF edge;
|
||||
|
||||
int i1, i2;
|
||||
if (i < EdgesCount())
|
||||
{
|
||||
edge = QLineF(points.at(i-1), points.at(i));
|
||||
i1 = i-1;
|
||||
i2 = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
edge = QLineF(points.at(EdgesCount()-1), points.at(0));
|
||||
i1 = EdgesCount()-1;
|
||||
i2 = 0;
|
||||
}
|
||||
|
||||
if (d->mirror)
|
||||
{
|
||||
const int oldI1 = i1;
|
||||
i1 = (d->layoutAllowence.size()-1) - i2;
|
||||
i2 = (d->layoutAllowence.size()-1) - oldI1;
|
||||
return QLineF(d->matrix.map(d->layoutAllowence.at(i2)), d->matrix.map(d->layoutAllowence.at(i1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return QLineF(d->matrix.map(d->layoutAllowence.at(i1)), d->matrix.map(d->layoutAllowence.at(i2)));
|
||||
}
|
||||
return edge;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -49,7 +49,8 @@ public:
|
|||
|
||||
VLayoutDetailData(const VLayoutDetailData &detail)
|
||||
:QSharedData(detail), contour(detail.contour), seamAllowence(detail.seamAllowence),
|
||||
layoutAllowence(detail.layoutAllowence), matrix(detail.matrix), layoutWidth(detail.layoutWidth), mirror(false)
|
||||
layoutAllowence(detail.layoutAllowence), matrix(detail.matrix), layoutWidth(detail.layoutWidth),
|
||||
mirror(detail.mirror)
|
||||
{}
|
||||
|
||||
~VLayoutDetailData() {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user