mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Drop the unused lines background drawing
This commit is contained in:
parent
4ce5dfbcf9
commit
fdd3613c4a
@ -99,25 +99,14 @@ void RasterTile::drawLines(QPainter *painter)
|
|||||||
|
|
||||||
painter->setBrush(Qt::NoBrush);
|
painter->setBrush(Qt::NoBrush);
|
||||||
|
|
||||||
for (int i = 0; i < _lines.size(); i++) {
|
|
||||||
const MapData::Line *line = _lines.at(i);
|
|
||||||
const Style::Line &style = s.line(line->type());
|
|
||||||
|
|
||||||
if (style.background() == Qt::NoPen)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
painter->setPen(style.background());
|
|
||||||
painter->drawPolyline(polyline(line->path()));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < _lines.size(); i++) {
|
for (int i = 0; i < _lines.size(); i++) {
|
||||||
const MapData::Line *line = _lines.at(i);
|
const MapData::Line *line = _lines.at(i);
|
||||||
const Style::Line &style = s.line(line->type());
|
const Style::Line &style = s.line(line->type());
|
||||||
|
|
||||||
if (!style.img().isNull()) {
|
if (!style.img().isNull()) {
|
||||||
BitmapLine::draw(painter, polyline(line->path()), style.img());
|
BitmapLine::draw(painter, polyline(line->path()), style.img());
|
||||||
} else if (style.foreground() != Qt::NoPen) {
|
} else if (style.pen() != Qt::NoPen) {
|
||||||
painter->setPen(style.foreground());
|
painter->setPen(style.pen());
|
||||||
painter->drawPolyline(polyline(line->path()));
|
painter->drawPolyline(polyline(line->path()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,7 +154,7 @@ void RasterTile::processLines(QList<TextItem*> &textItems)
|
|||||||
const MapData::Line *line = _lines.at(i);
|
const MapData::Line *line = _lines.at(i);
|
||||||
const Style::Line &style = s.line(line->type());
|
const Style::Line &style = s.line(line->type());
|
||||||
|
|
||||||
if (style.img().isNull() && style.foreground() == Qt::NoPen)
|
if (style.img().isNull() && style.pen() == Qt::NoPen)
|
||||||
continue;
|
continue;
|
||||||
if (line->label().isEmpty() || style.textFontSize() == Style::None)
|
if (line->label().isEmpty() || style.textFontSize() == Style::None)
|
||||||
continue;
|
continue;
|
||||||
|
@ -36,27 +36,22 @@ public:
|
|||||||
|
|
||||||
class Line {
|
class Line {
|
||||||
public:
|
public:
|
||||||
Line() : _foreground(Qt::NoPen), _background(Qt::NoPen),
|
Line() : _pen(Qt::NoPen), _textFontSize(None) {}
|
||||||
_textFontSize(None) {}
|
Line(const QPen &pen) : _pen(pen), _textFontSize(None) {}
|
||||||
Line(const QPen &foreground, const QPen &background = Qt::NoPen)
|
|
||||||
: _foreground(foreground), _background(background),
|
|
||||||
_textFontSize(None) {}
|
|
||||||
Line(const QImage &img)
|
Line(const QImage &img)
|
||||||
: _foreground(Qt::NoPen), _background(Qt::NoPen),
|
: _pen(Qt::NoPen), _textFontSize(None), _img(img.convertToFormat(
|
||||||
_textFontSize(None), _img(img.convertToFormat(
|
|
||||||
QImage::Format_ARGB32_Premultiplied)) {}
|
QImage::Format_ARGB32_Premultiplied)) {}
|
||||||
|
|
||||||
void setTextColor(const QColor &color) {_textColor = color;}
|
void setTextColor(const QColor &color) {_textColor = color;}
|
||||||
void setTextFontSize(FontSize size) {_textFontSize = size;}
|
void setTextFontSize(FontSize size) {_textFontSize = size;}
|
||||||
|
|
||||||
const QPen &foreground() const {return _foreground;}
|
const QPen &pen() const {return _pen;}
|
||||||
const QPen &background() const {return _background;}
|
|
||||||
const QColor &textColor() const {return _textColor;}
|
const QColor &textColor() const {return _textColor;}
|
||||||
FontSize textFontSize() const {return _textFontSize;}
|
FontSize textFontSize() const {return _textFontSize;}
|
||||||
const QImage &img() const {return _img;}
|
const QImage &img() const {return _img;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPen _foreground, _background;
|
QPen _pen;
|
||||||
QColor _textColor;
|
QColor _textColor;
|
||||||
FontSize _textFontSize;
|
FontSize _textFontSize;
|
||||||
QImage _img;
|
QImage _img;
|
||||||
|
Loading…
Reference in New Issue
Block a user