diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index a7e35a2f..d9a8955d 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -302,17 +302,17 @@ void RasterTile::processPolygons(const QList &polygons, } void RasterTile::processLines(QList &lines, - QList &textItems, const QImage &arrow, const QImage &waterArrow) + QList &textItems, const QImage (&arrows)[2]) { std::stable_sort(lines.begin(), lines.end()); if (_zoom >= 22) - processStreetNames(lines, textItems, arrow, waterArrow); + processStreetNames(lines, textItems, arrows); processShields(lines, textItems); } void RasterTile::processStreetNames(const QList &lines, - QList &textItems, const QImage &arrow, const QImage &waterArrow) + QList &textItems, const QImage (&arrows)[2]) { for (int i = 0; i < lines.size(); i++) { const MapData::Poly &poly = lines.at(i); @@ -327,7 +327,7 @@ void RasterTile::processStreetNames(const QList &lines, const QColor *hColor = Style::isContourLine(poly.type) ? 0 : &haloColor; const QImage *img = poly.oneway ? Style::isWaterLine(poly.type) - ? &waterArrow : &arrow : 0; + ? &arrows[1] : &arrows[0] : 0; const QString *label = poly.label.text().isEmpty() ? 0 : &poly.label.text(); @@ -477,9 +477,11 @@ void RasterTile::render() QList lines; QList points; QList textItems; - QImage arrow = (_ratio >= 2) + QImage arrows[2]; + + arrows[0] = (_ratio >= 2) ? QImage(":/map/arrow@2x.png") : QImage(":/map/arrow.png"); - QImage waterArrow = (_ratio >= 2) + arrows[1] = (_ratio >= 2) ? QImage(":/map/water-arrow@2x.png") : QImage(":/map/water-arrow.png"); fetchData(polygons, lines, points); @@ -489,7 +491,7 @@ void RasterTile::render() processPoints(points, textItems); processPolygons(polygons, textItems); - processLines(lines, textItems, arrow, waterArrow); + processLines(lines, textItems, arrows); _pixmap.setDevicePixelRatio(_ratio); _pixmap.fill(Qt::transparent); diff --git a/src/map/IMG/rastertile.h b/src/map/IMG/rastertile.h index 9ba1724d..0b611559 100644 --- a/src/map/IMG/rastertile.h +++ b/src/map/IMG/rastertile.h @@ -44,14 +44,14 @@ private: void processPolygons(const QList &polygons, QList &textItems); - void processLines(QList &lines, - QList &textItems, const QImage &arrow, const QImage &waterArrow); + void processLines(QList &lines, QList &textItems, + const QImage (&arrows)[2]); void processPoints(QList &points, QList &textItems); void processShields(const QList &lines, QList &textItems); void processStreetNames(const QList &lines, - QList &textItems, const QImage &arrow, const QImage &waterArrow); + QList &textItems, const QImage (&arrows)[2]); Projection _proj; Transform _transform;