1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-03-17 20:17:45 +01:00

Alwas show the area pictograms

This commit is contained in:
Martin Tůma 2025-02-12 09:04:46 +01:00
parent 59be4aaf1a
commit c4e44c8796
3 changed files with 8 additions and 5 deletions

View File

@ -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;

View File

@ -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);

View File

@ -313,7 +313,7 @@ void RasterTile::processPoints(QList<MapData::Point> &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(),