diff --git a/src/map/mapsforge/rastertile.cpp b/src/map/mapsforge/rastertile.cpp index bfce1971..7b0f0b22 100644 --- a/src/map/mapsforge/rastertile.cpp +++ b/src/map/mapsforge/rastertile.cpp @@ -100,7 +100,7 @@ static QPainterPath parallelPath(const QPainterPath &p, double dy) } void RasterTile::processPointLabels(const QList &points, - QList &textItems) + QList &textItems) const { QList labels(_style->pointLabels(_zoom)); QList symbols(_style->pointSymbols(_zoom)); @@ -152,14 +152,14 @@ void RasterTile::processPointLabels(const QList &points, } } -void RasterTile::processAreaLabels(QList &textItems, - QVector &paths) +void RasterTile::processAreaLabels(const QVector &paths, + QList &textItems) const { QList labels(_style->areaLabels(_zoom)); QList symbols(_style->areaSymbols(_zoom)); for (int i = 0; i < paths.size(); i++) { - PainterPath &path = paths[i]; + const PainterPath &path = paths.at(i); const Style::TextRender *ti = 0; const Style::Symbol *si = 0; const QByteArray *lbl = 0; @@ -204,8 +204,8 @@ void RasterTile::processAreaLabels(QList &textItems, } } -void RasterTile::processLineLabels(QList &textItems, - QVector &paths) +void RasterTile::processLineLabels(const QVector &paths, + QList &textItems) const { QList instructions(_style->pathLabels(_zoom)); QSet set; @@ -214,7 +214,7 @@ void RasterTile::processLineLabels(QList &textItems, const Style::TextRender *ri = instructions.at(i); for (int i = 0; i < paths.size(); i++) { - PainterPath &path = paths[i]; + const PainterPath &path = paths.at(i); const QByteArray *lbl = label(ri->key(), path.path->tags); if (!lbl) @@ -288,7 +288,7 @@ QPainterPath RasterTile::painterPath(const Polygon &polygon, bool curve) const void RasterTile::pathInstructions(const QList &paths, QVector &painterPaths, - QVector &instructions) + QVector &instructions) const { QCache > cache(8192); QList *ri; @@ -314,7 +314,7 @@ void RasterTile::pathInstructions(const QList &paths, } void RasterTile::circleInstructions(const QList &points, - QVector &instructions) + QVector &instructions) const { QCache > cache(8192); QList *ri; @@ -373,7 +373,7 @@ void RasterTile::drawPaths(QPainter *painter, const QList &paths, } void RasterTile::fetchData(QList &paths, - QList &points) + QList &points) const { QPoint ttl(_rect.topLeft()); @@ -414,8 +414,8 @@ void RasterTile::render() drawPaths(&painter, paths, points, renderPaths); processPointLabels(points, textItems); - processAreaLabels(textItems, renderPaths); - processLineLabels(textItems, renderPaths); + processAreaLabels(renderPaths, textItems); + processLineLabels(renderPaths, textItems); drawTextItems(&painter, textItems); //painter.setPen(Qt::red); diff --git a/src/map/mapsforge/rastertile.h b/src/map/mapsforge/rastertile.h index ee3b159c..e3f7e0d5 100644 --- a/src/map/mapsforge/rastertile.h +++ b/src/map/mapsforge/rastertile.h @@ -146,20 +146,21 @@ private: friend HASH_T qHash(const RasterTile::PathKey &key); friend HASH_T qHash(const RasterTile::PointKey &key); - void fetchData(QList &paths, QList &points); + void fetchData(QList &paths, + QList &points) const; void pathInstructions(const QList &paths, QVector &painterPaths, - QVector &instructions); + QVector &instructions) const; void circleInstructions(const QList &points, - QVector &instructions); + QVector &instructions) const; QPointF ll2xy(const Coordinates &c) const {return _transform.proj2img(_proj.ll2xy(c));} void processPointLabels(const QList &points, - QList &textItems); - void processAreaLabels(QList &textItems, - QVector &paths); - void processLineLabels(QList &textItems, - QVector &paths); + QList &textItems) const; + void processAreaLabels(const QVector &paths, + QList &textItems) const; + void processLineLabels(const QVector &paths, + QList &textItems) const; QPainterPath painterPath(const Polygon &polygon, bool curve) const; void drawTextItems(QPainter *painter, const QList &textItems); void drawPaths(QPainter *painter, const QList &paths,