Cosmetics

This commit is contained in:
Martin Tůma 2018-10-29 22:35:05 +01:00
parent 40fc978ff1
commit ac7a56441a
2 changed files with 11 additions and 11 deletions

View File

@ -344,17 +344,17 @@ bool Style::Layer::match(int zoom, const QVariantMap &tags) const
void Style::Layer::drawPath(int zoom, const QPainterPath &path,
Tile &tile) const
{
QPainter *p = tile.painter();
QPainter &p = tile.painter();
QPen pen(_paint.pen(_type, zoom));
pen.setJoinStyle(_layout.lineJoin());
pen.setCapStyle(_layout.lineCap());
p->setRenderHint(QPainter::Antialiasing, _paint.antialias(_type));
p->setPen(pen);
p->setBrush(_paint.brush(_type, zoom));
p->setOpacity(_paint.opacity(_type, zoom));
p->drawPath(path);
p.setRenderHint(QPainter::Antialiasing, _paint.antialias(_type));
p.setPen(pen);
p.setBrush(_paint.brush(_type, zoom));
p.setOpacity(_paint.opacity(_type, zoom));
p.drawPath(path);
}
void Style::Layer::drawSymbol(int zoom, const QPainterPath &path,
@ -422,8 +422,8 @@ void Style::drawBackground(Tile &tile)
path.addRect(QRectF(0, 0, tile.size(), tile.size()));
if (_styles.isEmpty()) {
tile.painter()->setBrush(Qt::lightGray);
tile.painter()->drawPath(path);
tile.painter().setBrush(Qt::lightGray);
tile.painter().drawPath(path);
} else if (_styles.first().isBackground())
_styles.first().drawPath(_zoom, path, tile);
}

View File

@ -12,10 +12,10 @@ public:
int size() const {return _background.width();}
Text &text() {return _text;}
QPainter *painter() {return &_painter;}
QPainter &painter() {return _painter;}
QImage &render() {
_text.render(painter());
const QImage &render() {
_text.render(&painter());
return _background;
}