mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-20 09:40:49 +01:00
Do not draw IMG contour lines that have no color defined
This commit is contained in:
parent
af7696bfd7
commit
2026036015
@ -297,7 +297,8 @@ void RasterTile::processStreetNames(const QList<MapData::Poly> &lines,
|
|||||||
const QFont *fnt = _data->style()->font(style.text().size(),
|
const QFont *fnt = _data->style()->font(style.text().size(),
|
||||||
Style::Small);
|
Style::Small);
|
||||||
const QColor *color = style.text().color().isValid()
|
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 QColor *hColor = Style::isContourLine(poly.type) ? 0 : &haloColor;
|
||||||
const QImage *img = poly.oneway
|
const QImage *img = poly.oneway
|
||||||
? Style::isWaterLine(poly.type)
|
? Style::isWaterLine(poly.type)
|
||||||
@ -305,7 +306,7 @@ void RasterTile::processStreetNames(const QList<MapData::Poly> &lines,
|
|||||||
const QString *label = poly.label.text().isEmpty()
|
const QString *label = poly.label.text().isEmpty()
|
||||||
? 0 : &poly.label.text();
|
? 0 : &poly.label.text();
|
||||||
|
|
||||||
if (!img && (!label || !fnt))
|
if (!img && (!label || !fnt || !color))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TextPathItem *item = new TextPathItem(poly.points, label, _rect, fnt,
|
TextPathItem *item = new TextPathItem(poly.points, label, _rect, fnt,
|
||||||
|
@ -1026,7 +1026,8 @@ bool Style::parseLine(SubFile *file, SubFile::Handle &hdl,
|
|||||||
|
|
||||||
if (isContourLine(type)) {
|
if (isContourLine(type)) {
|
||||||
Line &l = _lines[type];
|
Line &l = _lines[type];
|
||||||
l.setTextColor(l.foreground().color());
|
if (l.img().isNull())
|
||||||
|
l.setTextColor(l.foreground().color());
|
||||||
l.setTextFontSize(Small);
|
l.setTextFontSize(Small);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ void TextPathItem::paint(QPainter *painter) const
|
|||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_text && _font) {
|
if (_text && _font && _color) {
|
||||||
QFontMetrics fm(*_font);
|
QFontMetrics fm(*_font);
|
||||||
int textWidth = fm.boundingRect(*_text).width();
|
int textWidth = fm.boundingRect(*_text).width();
|
||||||
int imgWidth = _img
|
int imgWidth = _img
|
||||||
@ -394,7 +394,7 @@ void TextPathItem::paint(QPainter *painter) const
|
|||||||
percent = ((1.0 - factor) + imgPercent) / 2.0;
|
percent = ((1.0 - factor) + imgPercent) / 2.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
painter->setPen(_color ? *_color : Qt::black);
|
painter->setPen(*_color);
|
||||||
for (int i = 0; i < _text->size(); i++) {
|
for (int i = 0; i < _text->size(); i++) {
|
||||||
QPointF point = _path.pointAtPercent(percent);
|
QPointF point = _path.pointAtPercent(percent);
|
||||||
qreal angle = _path.angleAtPercent(percent);
|
qreal angle = _path.angleAtPercent(percent);
|
||||||
|
@ -72,7 +72,7 @@ void TextPointItem::paint(QPainter *painter) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_text) {
|
if (_text && _font && _color) {
|
||||||
if (_bgColor) {
|
if (_bgColor) {
|
||||||
painter->setPen(*_color);
|
painter->setPen(*_color);
|
||||||
painter->setBrush(*_bgColor);
|
painter->setBrush(*_bgColor);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user