diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index 5e627776..fd5c9f03 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -297,7 +297,8 @@ void RasterTile::processStreetNames(const QList &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 &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, diff --git a/src/map/IMG/style.cpp b/src/map/IMG/style.cpp index 16c6f0a3..ca8fdff9 100644 --- a/src/map/IMG/style.cpp +++ b/src/map/IMG/style.cpp @@ -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); } diff --git a/src/map/textpathitem.cpp b/src/map/textpathitem.cpp index 0062d12a..55866117 100644 --- a/src/map/textpathitem.cpp +++ b/src/map/textpathitem.cpp @@ -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); diff --git a/src/map/textpointitem.cpp b/src/map/textpointitem.cpp index 5978f06c..c3a2af6d 100644 --- a/src/map/textpointitem.cpp +++ b/src/map/textpointitem.cpp @@ -72,7 +72,7 @@ void TextPointItem::paint(QPainter *painter) const } } - if (_text) { + if (_text && _font && _color) { if (_bgColor) { painter->setPen(*_color); painter->setBrush(*_bgColor);