1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Improved areas rendering performance

This commit is contained in:
Martin Tůma 2021-03-09 23:21:10 +01:00
parent 3ba684aafc
commit fa1025ea15

View File

@ -52,12 +52,10 @@ QPainterPath AreaItem::painterPath(const Polygon &polygon)
for (int i = 1; i < polygon.size(); i++) { for (int i = 1; i < polygon.size(); i++) {
const QVector<Coordinates> &lr = polygon.at(i); const QVector<Coordinates> &lr = polygon.at(i);
QPainterPath hole; path.moveTo(_map->ll2xy(lr.first()));
hole.moveTo(_map->ll2xy(lr.first()));
for (int j = 1; j < lr.size(); j++) for (int j = 1; j < lr.size(); j++)
hole.lineTo(_map->ll2xy(lr.at(j))); path.lineTo(_map->ll2xy(lr.at(j)));
hole.closeSubpath(); path.closeSubpath();
path = path.subtracted(hole);
} }
return path; return path;