mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Only preallocate the memory when usin moveto/lineto
This commit is contained in:
parent
81e967f20d
commit
e351eb6370
@ -200,6 +200,7 @@ QPainterPath RasterTile::painterPath(const Polygon &polygon, bool curve) const
|
||||
{
|
||||
QPainterPath path;
|
||||
|
||||
if (curve) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
||||
int size = 0;
|
||||
for (int i = 0; i < polygon.size(); i++)
|
||||
@ -210,7 +211,6 @@ QPainterPath RasterTile::painterPath(const Polygon &polygon, bool curve) const
|
||||
for (int i = 0; i < polygon.size(); i++) {
|
||||
const QVector<Coordinates> &subpath = polygon.at(i);
|
||||
|
||||
if (curve) {
|
||||
QPointF p1(ll2xy(subpath.first()));
|
||||
QPointF p2(0, 0);
|
||||
QPointF p3(0, 0);
|
||||
@ -223,7 +223,11 @@ QPainterPath RasterTile::painterPath(const Polygon &polygon, bool curve) const
|
||||
p1 = p3;
|
||||
}
|
||||
path.quadTo(p2, p3);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < polygon.size(); i++) {
|
||||
const QVector<Coordinates> &subpath = polygon.at(i);
|
||||
|
||||
QVector<QPointF> p(subpath.size());
|
||||
for (int j = 0; j < subpath.size(); j++)
|
||||
p[j] = ll2xy(subpath.at(j));
|
||||
|
Loading…
x
Reference in New Issue
Block a user