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

Do not draw IMG contour lines that have no color defined

This commit is contained in:
Martin Tůma 2024-02-27 07:20:09 +01:00
parent af7696bfd7
commit 2026036015
4 changed files with 8 additions and 6 deletions

View File

@ -297,7 +297,8 @@ void RasterTile::processStreetNames(const QList<MapData::Poly> &lines,
const QFont *fnt = _data->style()->font(style.text().size(),
Style::Small);
const QColor *color = style.text().color().isValid()
? &style.text().color() : 0;
? &style.text().color() : Style::isContourLine(poly.type)
? 0 : &textColor;
const QColor *hColor = Style::isContourLine(poly.type) ? 0 : &haloColor;
const QImage *img = poly.oneway
? Style::isWaterLine(poly.type)
@ -305,7 +306,7 @@ void RasterTile::processStreetNames(const QList<MapData::Poly> &lines,
const QString *label = poly.label.text().isEmpty()
? 0 : &poly.label.text();
if (!img && (!label || !fnt))
if (!img && (!label || !fnt || !color))
continue;
TextPathItem *item = new TextPathItem(poly.points, label, _rect, fnt,

View File

@ -1026,7 +1026,8 @@ bool Style::parseLine(SubFile *file, SubFile::Handle &hdl,
if (isContourLine(type)) {
Line &l = _lines[type];
l.setTextColor(l.foreground().color());
if (l.img().isNull())
l.setTextColor(l.foreground().color());
l.setTextFontSize(Small);
}

View File

@ -356,7 +356,7 @@ void TextPathItem::paint(QPainter *painter) const
painter->restore();
}
if (_text && _font) {
if (_text && _font && _color) {
QFontMetrics fm(*_font);
int textWidth = fm.boundingRect(*_text).width();
int imgWidth = _img
@ -394,7 +394,7 @@ void TextPathItem::paint(QPainter *painter) const
percent = ((1.0 - factor) + imgPercent) / 2.0;
}
painter->setPen(_color ? *_color : Qt::black);
painter->setPen(*_color);
for (int i = 0; i < _text->size(); i++) {
QPointF point = _path.pointAtPercent(percent);
qreal angle = _path.angleAtPercent(percent);

View File

@ -72,7 +72,7 @@ void TextPointItem::paint(QPainter *painter) const
}
}
if (_text) {
if (_text && _font && _color) {
if (_bgColor) {
painter->setPen(*_color);
painter->setBrush(*_bgColor);