Fix crash if a piece contour is empty.
This commit is contained in:
parent
b2e75261b7
commit
453736dfbc
|
@ -1929,12 +1929,15 @@ QPainterPath VAbstractPiece::PainterPath(const QVector<QPointF> &points)
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.setFillRule(Qt::WindingFill);
|
path.setFillRule(Qt::WindingFill);
|
||||||
|
|
||||||
path.moveTo(points.at(0));
|
if (not points.isEmpty())
|
||||||
for (qint32 i = 1; i < points.count(); ++i)
|
|
||||||
{
|
{
|
||||||
path.lineTo(points.at(i));
|
path.moveTo(points.at(0));
|
||||||
|
for (qint32 i = 1; i < points.count(); ++i)
|
||||||
|
{
|
||||||
|
path.lineTo(points.at(i));
|
||||||
|
}
|
||||||
|
path.lineTo(points.at(0));
|
||||||
}
|
}
|
||||||
path.lineTo(points.at(0));
|
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user