mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-11-24 03:35:54 +01:00
Cosmetics
This commit is contained in:
parent
40fc978ff1
commit
ac7a56441a
@ -344,17 +344,17 @@ bool Style::Layer::match(int zoom, const QVariantMap &tags) const
|
|||||||
void Style::Layer::drawPath(int zoom, const QPainterPath &path,
|
void Style::Layer::drawPath(int zoom, const QPainterPath &path,
|
||||||
Tile &tile) const
|
Tile &tile) const
|
||||||
{
|
{
|
||||||
QPainter *p = tile.painter();
|
QPainter &p = tile.painter();
|
||||||
|
|
||||||
QPen pen(_paint.pen(_type, zoom));
|
QPen pen(_paint.pen(_type, zoom));
|
||||||
pen.setJoinStyle(_layout.lineJoin());
|
pen.setJoinStyle(_layout.lineJoin());
|
||||||
pen.setCapStyle(_layout.lineCap());
|
pen.setCapStyle(_layout.lineCap());
|
||||||
|
|
||||||
p->setRenderHint(QPainter::Antialiasing, _paint.antialias(_type));
|
p.setRenderHint(QPainter::Antialiasing, _paint.antialias(_type));
|
||||||
p->setPen(pen);
|
p.setPen(pen);
|
||||||
p->setBrush(_paint.brush(_type, zoom));
|
p.setBrush(_paint.brush(_type, zoom));
|
||||||
p->setOpacity(_paint.opacity(_type, zoom));
|
p.setOpacity(_paint.opacity(_type, zoom));
|
||||||
p->drawPath(path);
|
p.drawPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Style::Layer::drawSymbol(int zoom, const QPainterPath &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()));
|
path.addRect(QRectF(0, 0, tile.size(), tile.size()));
|
||||||
|
|
||||||
if (_styles.isEmpty()) {
|
if (_styles.isEmpty()) {
|
||||||
tile.painter()->setBrush(Qt::lightGray);
|
tile.painter().setBrush(Qt::lightGray);
|
||||||
tile.painter()->drawPath(path);
|
tile.painter().drawPath(path);
|
||||||
} else if (_styles.first().isBackground())
|
} else if (_styles.first().isBackground())
|
||||||
_styles.first().drawPath(_zoom, path, tile);
|
_styles.first().drawPath(_zoom, path, tile);
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,10 @@ public:
|
|||||||
|
|
||||||
int size() const {return _background.width();}
|
int size() const {return _background.width();}
|
||||||
Text &text() {return _text;}
|
Text &text() {return _text;}
|
||||||
QPainter *painter() {return &_painter;}
|
QPainter &painter() {return _painter;}
|
||||||
|
|
||||||
QImage &render() {
|
const QImage &render() {
|
||||||
_text.render(painter());
|
_text.render(&painter());
|
||||||
return _background;
|
return _background;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user