diff --git a/icons/map/marine/anchorage.png b/icons/map/marine/anchorage.png index a1fa0d23..9b8f2de6 100644 Binary files a/icons/map/marine/anchorage.png and b/icons/map/marine/anchorage.png differ diff --git a/icons/map/marine/anchoring-prohibited.png b/icons/map/marine/anchoring-prohibited.png index d9268d62..b17d2317 100644 Binary files a/icons/map/marine/anchoring-prohibited.png and b/icons/map/marine/anchoring-prohibited.png differ diff --git a/icons/map/marine/beacon.png b/icons/map/marine/beacon.png index 1a77598f..d97883b9 100644 Binary files a/icons/map/marine/beacon.png and b/icons/map/marine/beacon.png differ diff --git a/icons/map/marine/buoy.png b/icons/map/marine/buoy.png index 44a96174..b32bfab2 100644 Binary files a/icons/map/marine/buoy.png and b/icons/map/marine/buoy.png differ diff --git a/icons/map/marine/chimney.png b/icons/map/marine/chimney.png index 6fb49a06..2a1d45be 100644 Binary files a/icons/map/marine/chimney.png and b/icons/map/marine/chimney.png differ diff --git a/icons/map/marine/crane.png b/icons/map/marine/crane.png index 8940979c..37c6fb71 100644 Binary files a/icons/map/marine/crane.png and b/icons/map/marine/crane.png differ diff --git a/icons/map/marine/flagstaff.png b/icons/map/marine/flagstaff.png index 2c07cdc0..59a17aff 100644 Binary files a/icons/map/marine/flagstaff.png and b/icons/map/marine/flagstaff.png differ diff --git a/icons/map/marine/fleeting-area.png b/icons/map/marine/fleeting-area.png index 4127c6bb..35a84c30 100644 Binary files a/icons/map/marine/fleeting-area.png and b/icons/map/marine/fleeting-area.png differ diff --git a/icons/map/marine/fog-signal.png b/icons/map/marine/fog-signal.png index d6eeecda..83288877 100644 Binary files a/icons/map/marine/fog-signal.png and b/icons/map/marine/fog-signal.png differ diff --git a/icons/map/marine/gauge.png b/icons/map/marine/gauge.png index fe32fda4..6ce98d42 100644 Binary files a/icons/map/marine/gauge.png and b/icons/map/marine/gauge.png differ diff --git a/icons/map/marine/light-major.png b/icons/map/marine/light-major.png index 777f6c26..34c4d331 100644 Binary files a/icons/map/marine/light-major.png and b/icons/map/marine/light-major.png differ diff --git a/icons/map/marine/light-platform.png b/icons/map/marine/light-platform.png index a6b21e45..30409846 100644 Binary files a/icons/map/marine/light-platform.png and b/icons/map/marine/light-platform.png differ diff --git a/icons/map/marine/light.png b/icons/map/marine/light.png index a11ed95f..8ff3dfdc 100644 Binary files a/icons/map/marine/light.png and b/icons/map/marine/light.png differ diff --git a/icons/map/marine/monument.png b/icons/map/marine/monument.png index f2613ee4..66a07b26 100644 Binary files a/icons/map/marine/monument.png and b/icons/map/marine/monument.png differ diff --git a/icons/map/marine/mooring-buoy.png b/icons/map/marine/mooring-buoy.png index 02178029..8d9c3462 100644 Binary files a/icons/map/marine/mooring-buoy.png and b/icons/map/marine/mooring-buoy.png differ diff --git a/icons/map/marine/spar-buoy.png b/icons/map/marine/spar-buoy.png index 2d88a756..5c15a05e 100644 Binary files a/icons/map/marine/spar-buoy.png and b/icons/map/marine/spar-buoy.png differ diff --git a/icons/map/marine/tower.png b/icons/map/marine/tower.png index 351affad..dfee2e8b 100644 Binary files a/icons/map/marine/tower.png and b/icons/map/marine/tower.png differ diff --git a/icons/map/marine/windmotor.png b/icons/map/marine/windmotor.png index 1fcc58d1..738daccd 100644 Binary files a/icons/map/marine/windmotor.png and b/icons/map/marine/windmotor.png differ diff --git a/icons/map/marine/wreck-exposed.png b/icons/map/marine/wreck-exposed.png index fd1268e3..21704e76 100644 Binary files a/icons/map/marine/wreck-exposed.png and b/icons/map/marine/wreck-exposed.png differ diff --git a/src/map/ENC/rastertile.cpp b/src/map/ENC/rastertile.cpp index 08f946d1..c98ccc08 100644 --- a/src/map/ENC/rastertile.cpp +++ b/src/map/ENC/rastertile.cpp @@ -297,16 +297,18 @@ void RasterTile::processPoints(QList &points, if ((!label || !fnt) && !img) continue; - TextPointItem *item = new TextPointItem(pos, label, fnt, img, color, - hColor, 0, 2, rotate); + QPoint offset = img ? style.offset() : QPoint(0, 0); + + TextPointItem *item = new TextPointItem(pos + offset, label, fnt, img, + color, hColor, 0, 2, rotate); if (item->isValid() && !item->collides(textItems)) { textItems.append(item); if (lightsSet.contains(point.pos())) - lights.append(new TextPointItem(pos, 0, 0, _style->light(), 0, - 0, 0, 0)); + lights.append(new TextPointItem(pos + _style->lightOffset(), + 0, 0, _style->light(), 0, 0, 0, 0)); if (signalsSet.contains(point.pos())) - lights.append(new TextPointItem(pos, 0, 0, _style->signal(), 0, - 0, 0, 0)); + lights.append(new TextPointItem(pos + _style->signalOffset(), + 0, 0, _style->signal(), 0, 0, 0, 0)); } else delete item; } diff --git a/src/map/ENC/style.cpp b/src/map/ENC/style.cpp index fd4e1659..2c56e838 100644 --- a/src/map/ENC/style.cpp +++ b/src/map/ENC/style.cpp @@ -202,27 +202,45 @@ void Style::pointStyle(qreal ratio) _points[SUBTYPE(BUAARE, 6)].setTextFontSize(Small); _points[TYPE(SOUNDG)].setTextFontSize(Small); _points[TYPE(SOUNDG)].setHaloColor(QColor()); - _points[TYPE(BOYCAR)] = Point(QImage(":/marine/buoy.png"), Small); - _points[TYPE(BOYINB)] = Point(QImage(":/marine/buoy.png"), Small); - _points[TYPE(BOYISD)] = Point(QImage(":/marine/buoy.png"), Small); - _points[TYPE(BOYLAT)] = Point(QImage(":/marine/buoy.png"), Small); - _points[TYPE(I_BOYLAT)] = Point(QImage(":/marine/buoy.png"), Small); - _points[TYPE(BOYSAW)] = Point(QImage(":/marine/buoy.png"), Small); - _points[TYPE(BOYSPP)] = Point(QImage(":/marine/buoy.png"), Small); - _points[TYPE(BCNCAR)] = Point(QImage(":/marine/beacon.png"), Small); - _points[TYPE(BCNISD)] = Point(QImage(":/marine/beacon.png"), Small); - _points[TYPE(BCNLAT)] = Point(QImage(":/marine/beacon.png"), Small); - _points[TYPE(I_BCNLAT)] = Point(QImage(":/marine/beacon.png"), Small); - _points[TYPE(BCNSAW)] = Point(QImage(":/marine/beacon.png"), Small); - _points[TYPE(BCNSPP)] = Point(QImage(":/marine/beacon.png"), Small); - _points[SUBTYPE(LNDMRK, 3)] = Point(QImage(":/marine/chimney.png")); - _points[SUBTYPE(LNDMRK, 5)] = Point(QImage(":/marine/flagstaff.png")); - _points[SUBTYPE(LNDMRK, 7)] = Point(QImage(":/marine/pylon.png")); - _points[SUBTYPE(LNDMRK, 9)] = Point(QImage(":/marine/monument.png")); - _points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png")); - _points[SUBTYPE(LNDMRK, 18)] = Point(QImage(":/marine/windmill.png")); - _points[SUBTYPE(LNDMRK, 19)] = Point(QImage(":/marine/windmotor.png")); - _points[SUBTYPE(LNDMRK, 20)] = Point(QImage(":/marine/church.png")); + _points[TYPE(BOYCAR)] = Point(QImage(":/marine/buoy.png"), Small, + QPoint(6, -6)); + _points[TYPE(BOYINB)] = Point(QImage(":/marine/buoy.png"), Small, + QPoint(6, -6)); + _points[TYPE(BOYISD)] = Point(QImage(":/marine/buoy.png"), Small, + QPoint(6, -6)); + _points[TYPE(BOYLAT)] = Point(QImage(":/marine/buoy.png"), Small, + QPoint(6, -6)); + _points[TYPE(I_BOYLAT)] = Point(QImage(":/marine/buoy.png"), Small, + QPoint(6, -6)); + _points[TYPE(BOYSAW)] = Point(QImage(":/marine/buoy.png"), Small, + QPoint(6, -6)); + _points[TYPE(BOYSPP)] = Point(QImage(":/marine/buoy.png"), Small, + QPoint(6, -6)); + _points[TYPE(BCNCAR)] = Point(QImage(":/marine/beacon.png"), Small, + QPoint(0, -8)); + _points[TYPE(BCNISD)] = Point(QImage(":/marine/beacon.png"), Small, + QPoint(0, -8)); + _points[TYPE(BCNLAT)] = Point(QImage(":/marine/beacon.png"), Small, + QPoint(0, -8)); + _points[TYPE(I_BCNLAT)] = Point(QImage(":/marine/beacon.png"), Small, + QPoint(0, -8)); + _points[TYPE(BCNSAW)] = Point(QImage(":/marine/beacon.png"), Small, + QPoint(0, -8)); + _points[TYPE(BCNSPP)] = Point(QImage(":/marine/beacon.png"), Small, + QPoint(0, -8)); + _points[SUBTYPE(LNDMRK, 3)] = Point(QImage(":/marine/chimney.png"), + Small, QPoint(0, -11)); + _points[SUBTYPE(LNDMRK, 5)] = Point(QImage(":/marine/flagstaff.png"), + Small, QPoint(2, -11)); + _points[SUBTYPE(LNDMRK, 7)] = Point(QImage(":/marine/pylon.png"), Small); + _points[SUBTYPE(LNDMRK, 9)] = Point(QImage(":/marine/monument.png"), Small, + QPoint(0, -7)); + _points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png"), Small, + QPoint(0, -11)); + _points[SUBTYPE(LNDMRK, 18)] = Point(QImage(":/marine/windmill.png"), Small); + _points[SUBTYPE(LNDMRK, 19)] = Point(QImage(":/marine/windmotor.png"), + Small, QPoint(0, -11)); + _points[SUBTYPE(LNDMRK, 20)] = Point(QImage(":/marine/church.png"), Small); _points[TYPE(LNDELV)] = Point(QImage(":/marine/triangulation-point.png")); _points[TYPE(OBSTRN)] = Point(QImage(":/marine/obstruction.png"), Small); _points[SUBTYPE(WRECKS, 0)] = Point(QImage(":/marine/wreck.png"), Small); @@ -231,7 +249,8 @@ void Style::pointStyle(qreal ratio) Small); _points[SUBTYPE(WRECKS, 3)] = Point(QImage(":/marine/wreck.png"), Small); _points[SUBTYPE(WRECKS, 4)] = Point(QImage(":/marine/wreck.png"), Small); - _points[SUBTYPE(WRECKS, 5)] = Point(QImage(":/marine/wreck-exposed.png")); + _points[SUBTYPE(WRECKS, 5)] = Point(QImage(":/marine/wreck-exposed.png"), + Small, QPoint(0, -4)); _points[SUBTYPE(UWTROC, 1)] = Point(QImage(":/marine/rock-exposed.png"), Small); _points[SUBTYPE(UWTROC, 2)] = Point(QImage(":/marine/rock-exposed.png"), @@ -256,9 +275,11 @@ void Style::pointStyle(qreal ratio) _points[SUBTYPE(MORFAC, 3)] = Point(QImage(":/marine/pile.png"), Small); _points[SUBTYPE(MORFAC, 5)] = Point(QImage(":/marine/pile.png"), Small); _points[SUBTYPE(MORFAC, 7)] = Point(QImage(":/marine/mooring-buoy.png"), - Small); - _points[TYPE(CRANES)] = Point(QImage(":/marine/crane.png"), Small); - _points[TYPE(I_CRANES)] = Point(QImage(":/marine/crane.png"), Small); + Small, QPoint(0, -5)); + _points[TYPE(CRANES)] = Point(QImage(":/marine/crane.png"), Small, + QPoint(0, -5)); + _points[TYPE(I_CRANES)] = Point(QImage(":/marine/crane.png"), Small, + QPoint(0, -5)); _points[SUBTYPE(I_DISMAR, 1)] = Point(QImage(":/marine/distance-mark.png"), Small); _points[SUBTYPE(I_DISMAR, 1)].setTextColor(QColor(0xff, 0xff, 0xff)); @@ -352,7 +373,9 @@ void Style::pointStyle(qreal ratio) Style::Style(qreal ratio) { _light = QImage(":/marine/light.png"); + _lightOffset = QPoint(11, 11); _signal = QImage(":/marine/fog-signal.png"); + _signalOffset = QPoint(-9, 9); _large = pixelSizeFont(16); _normal = pixelSizeFont(12); diff --git a/src/map/ENC/style.h b/src/map/ENC/style.h index 74a0ce25..ef62d38e 100644 --- a/src/map/ENC/style.h +++ b/src/map/ENC/style.h @@ -67,9 +67,10 @@ class Style public: Point() : _textColor(Qt::black), _haloColor(Qt::white), _textFontSize(Normal) {} - Point(const QImage &img, FontSize fontSize = Normal) + Point(const QImage &img, FontSize fontSize = Normal, + const QPoint &offset = QPoint(0, 0)) : _textColor(Qt::black), _haloColor(Qt::white), - _textFontSize(fontSize), _img(img) {} + _textFontSize(fontSize), _img(img), _offset(offset) {} void setTextColor(const QColor &color) {_textColor = color;} void setHaloColor(const QColor &color) {_haloColor = color;} @@ -79,11 +80,13 @@ class Style const QColor &haloColor() const {return _haloColor;} FontSize textFontSize() const {return _textFontSize;} const QImage &img() const {return _img;} + const QPoint &offset() const {return _offset;} private: QColor _textColor, _haloColor; FontSize _textFontSize; QImage _img; + QPoint _offset; }; Style(qreal ratio); @@ -96,6 +99,8 @@ class Style const QFont *font(Style::FontSize size) const; const QImage *light() const {return &_light;} const QImage *signal() const {return &_signal;} + const QPoint &lightOffset() const {return _lightOffset;} + const QPoint &signalOffset() const {return _signalOffset;} private: void polygonStyle(); @@ -110,6 +115,7 @@ class Style /* Fonts and images must be initialized after QGuiApplication! */ QFont _small, _normal, _large; QImage _light, _signal; + QPoint _lightOffset, _signalOffset; }; } diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index bcc8fb2b..d88813d2 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -422,8 +422,10 @@ void RasterTile::processPoints(QList &points, if ((!label || !fnt) && !img) continue; + QPoint offset = img ? style.offset() : QPoint(0, 0); + TextPointItem *item = new TextPointItem(QPoint(point.coordinates.lon(), - point.coordinates.lat()), label, fnt, img, color, hcolor, 0, + point.coordinates.lat()) + offset, label, fnt, img, color, hcolor, 0, ICON_PADDING); if (item->isValid() && !item->collides(textItems)) textItems.append(item); diff --git a/src/map/IMG/style.cpp b/src/map/IMG/style.cpp index e7ea490b..f0a555cd 100644 --- a/src/map/IMG/style.cpp +++ b/src/map/IMG/style.cpp @@ -670,48 +670,49 @@ void Style::defaultPointStyle(qreal ratio) _points[0x11108] = _points[0x3008]; // Marine stuff - _points[0x10100] = Point(QImage(":/marine/light-major.png")); - _points[0x10101] = Point(QImage(":/marine/light-major.png")); - _points[0x10102] = Point(QImage(":/marine/light-major.png")); - _points[0x10103] = Point(QImage(":/marine/light-major.png")); - _points[0x10104] = Point(QImage(":/marine/light-major.png")); - _points[0x10105] = Point(QImage(":/marine/light-major.png")); - _points[0x10106] = Point(QImage(":/marine/light-major.png")); - _points[0x10107] = Point(QImage(":/marine/light-major.png")); - _points[0x10108] = Point(QImage(":/marine/light-major.png")); - _points[0x10109] = Point(QImage(":/marine/light-major.png")); - _points[0x1010a] = Point(QImage(":/marine/light-major.png")); - _points[0x10200] = Point(QImage(":/marine/buoy.png")); - _points[0x10201] = Point(QImage(":/marine/buoy.png")); - _points[0x10202] = Point(QImage(":/marine/buoy.png")); - _points[0x10203] = Point(QImage(":/marine/buoy.png")); - _points[0x10204] = Point(QImage(":/marine/buoy.png")); - _points[0x10205] = Point(QImage(":/marine/buoy.png")); - _points[0x10206] = Point(QImage(":/marine/beacon.png")); - _points[0x10207] = Point(QImage(":/marine/spar-buoy.png")); - _points[0x10209] = Point(QImage(":/marine/buoy.png")); - _points[0x1020a] = Point(QImage(":/marine/buoy.png")); - _points[0x1020b] = Point(QImage(":/marine/buoy.png")); - _points[0x1020d] = Point(QImage(":/marine/light-platform.png")); - _points[0x1020e] = Point(QImage(":/marine/beacon.png")); - _points[0x1020f] = Point(QImage(":/marine/beacon.png")); - _points[0x10210] = Point(QImage(":/marine/beacon.png")); - _points[0x10211] = Point(QImage(":/marine/beacon.png")); - _points[0x10212] = Point(QImage(":/marine/beacon.png")); - _points[0x10213] = Point(QImage(":/marine/beacon.png")); - _points[0x10214] = Point(QImage(":/marine/beacon.png")); - _points[0x10215] = Point(QImage(":/marine/beacon.png")); - _points[0x10216] = Point(QImage(":/marine/mooring-buoy.png")); - _points[0x10305] = Point(QImage(":/marine/chimney.png")); + _points[0x10100] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10101] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10102] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10103] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10104] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10105] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10106] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10107] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10108] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10109] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x1010a] = Point(QImage(":/marine/light-major.png"), QPoint(8, -8)); + _points[0x10200] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x10201] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x10202] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x10203] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x10204] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x10205] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x10206] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x10207] = Point(QImage(":/marine/spar-buoy.png"), QPoint(2, -9)); + _points[0x10209] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x1020a] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x1020b] = Point(QImage(":/marine/buoy.png"), QPoint(6, -6)); + _points[0x1020d] = Point(QImage(":/marine/light-platform.png"), + QPoint(8, -8)); + _points[0x1020e] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x1020f] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x10210] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x10211] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x10212] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x10213] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x10214] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x10215] = Point(QImage(":/marine/beacon.png"), QPoint(0, -8)); + _points[0x10216] = Point(QImage(":/marine/mooring-buoy.png"), QPoint(0, -5)); + _points[0x10305] = Point(QImage(":/marine/chimney.png"), QPoint(0, -11)); _points[0x10306] = Point(QImage(":/marine/church.png")); _points[0x10307] = Point(QImage(":/marine/silo.png")); - _points[0x10308] = Point(QImage(":/marine/tower.png")); + _points[0x10308] = Point(QImage(":/marine/tower.png"), QPoint(0, -11)); _points[0x1030a] = Point(QImage(":/marine/triangulation-point.png")); _points[0x1030b] = Point(QImage(":/marine/radio.png")); _points[0x10400] = Point(QImage(":/marine/obstruction.png")); _points[0x10401] = Point(QImage(":/marine/obstruction.png")); _points[0x10402] = Point(QImage(":/marine/wreck.png")); - _points[0x10403] = Point(QImage(":/marine/wreck-exposed.png")); + _points[0x10403] = Point(QImage(":/marine/wreck-exposed.png"), QPoint(0, -4)); _points[0x10408] = Point(QImage(":/marine/obstruction-covers.png")); _points[0x1040a] = Point(QImage(":/marine/rock-dangerous.png")); _points[0x1040c] = Point(QImage(":/marine/rock-exposed.png")); diff --git a/src/map/IMG/style.h b/src/map/IMG/style.h index dad49014..eec09345 100644 --- a/src/map/IMG/style.h +++ b/src/map/IMG/style.h @@ -85,10 +85,12 @@ class Style Point() {} Point(FontSize fontSize, const QColor &textColor = QColor()) : _text(textColor, fontSize) {} - Point(const QImage &img) : _img(img) {} + Point(const QImage &img, const QPoint &offset = QPoint(0, 0)) + : _img(img), _offset(offset) {} const Font &text() const {return _text;} const QImage &img() const {return _img;} + const QPoint &offset() const {return _offset;} private: friend class Style; @@ -98,6 +100,7 @@ class Style Font _text; QImage _img; + QPoint _offset; };