From c4e44c87967f1ce91cb20c979ae6c7b74189b6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 12 Feb 2025 09:04:46 +0100 Subject: [PATCH] Alwas show the area pictograms --- src/map/ENC/mapdata.cpp | 6 +++--- src/map/ENC/mapdata.h | 5 ++++- src/map/ENC/rastertile.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/map/ENC/mapdata.cpp b/src/map/ENC/mapdata.cpp index 41c594e2..d68c866e 100644 --- a/src/map/ENC/mapdata.cpp +++ b/src/map/ENC/mapdata.cpp @@ -185,7 +185,7 @@ static bool polygonPointCb(const MapData::Poly *polygon, void *context) || type == SUBTYPE(I_ACHARE, 3) || type == SUBTYPE(I_ACHARE, 9) || type == SUBTYPE(I_BERTHS, 6)) points->append(MapData::Point(baseType, polygon->bounds().center(), - polygon->attributes(), polygon->HUNI())); + polygon->attributes(), polygon->HUNI(), true)); return true; } @@ -286,13 +286,13 @@ static QString weed(uint type) } MapData::Point::Point(uint type, const Coordinates &c, const QString &label) - : _type(SUBTYPE(type, 0)), _pos(c), _label(label) + : _type(SUBTYPE(type, 0)), _pos(c), _label(label), _polygon(false) { _id = ((quint64)order(_type))<<32 | (uint)qHash(c); } MapData::Point::Point(uint type, const Coordinates &c, const Attributes &attr, - uint HUNI) : _pos(c), _attr(attr) + uint HUNI, bool polygon) : _pos(c), _attr(attr), _polygon(polygon) { uint subtype = 0; diff --git a/src/map/ENC/mapdata.h b/src/map/ENC/mapdata.h index 92e1b137..74de79bb 100644 --- a/src/map/ENC/mapdata.h +++ b/src/map/ENC/mapdata.h @@ -49,13 +49,15 @@ public: class Point { public: - Point(uint type, const Coordinates &c, const Attributes &attr, uint HUNI); + Point(uint type, const Coordinates &c, const Attributes &attr, + uint HUNI, bool polygon = false); Point(uint type, const Coordinates &s, const QString &label); const Coordinates &pos() const {return _pos;} uint type() const {return _type;} const QString &label() const {return _label;} const Attributes &attributes() const {return _attr;} + bool polygon() const {return _polygon;} bool operator<(const Point &other) const {return _id < other._id;} @@ -66,6 +68,7 @@ public: QString _label; quint64 _id; Attributes _attr; + bool _polygon; }; MapData(const QString &path); diff --git a/src/map/ENC/rastertile.cpp b/src/map/ENC/rastertile.cpp index 1f4b9a25..c0e57efb 100644 --- a/src/map/ENC/rastertile.cpp +++ b/src/map/ENC/rastertile.cpp @@ -313,7 +313,7 @@ void RasterTile::processPoints(QList &points, TextPointItem *item = new TextPointItem(pos + offset, label, fnt, img, color, hColor, 0, 2, rotate); if (item->isValid() && (slMap.contains(point.pos()) - || !item->collides(textItems))) { + || (point.polygon() && img) || !item->collides(textItems))) { textItems.append(item); if (lightsMap.contains(point.pos())) lights.append(new TextPointItem(pos + _style->lightOffset(),