Fixed broken down-scaling

This commit is contained in:
Martin Tůma 2019-10-03 08:38:48 +02:00
parent 3f6b5faa2c
commit aacc42c25d
2 changed files with 4 additions and 3 deletions

View File

@ -75,8 +75,8 @@ bool PBFHandler::read(QImage *image)
QSize size = _scaledSize.isValid() QSize size = _scaledSize.isValid()
? _scaledSize : QSize(TILE_SIZE, TILE_SIZE); ? _scaledSize : QSize(TILE_SIZE, TILE_SIZE);
QPointF scale = _scaledSize.isValid() QPointF scale = _scaledSize.isValid()
? QPointF(_scaledSize.width() / TILE_SIZE, _scaledSize.height() / TILE_SIZE) ? QPointF((qreal)_scaledSize.width() / TILE_SIZE,
: QPointF(1.0, 1.0); (qreal)_scaledSize.height() / TILE_SIZE) : QPointF(1.0, 1.0);
*image = QImage(size, QImage::Format_ARGB32_Premultiplied); *image = QImage(size, QImage::Format_ARGB32_Premultiplied);
Tile tile(image, ok ? zoom : -1, scale); Tile tile(image, ok ? zoom : -1, scale);

View File

@ -597,7 +597,8 @@ void Style::setupLayer(Tile &tile, const Layer &layer) const
void Style::drawBackground(Tile &tile) const void Style::drawBackground(Tile &tile) const
{ {
QRectF rect(QPointF(0, 0), tile.size()); QRectF rect(QPointF(0, 0), QSizeF(tile.size().width() / tile.scale().x(),
tile.size().height() / tile.scale().y()));
QPainterPath path; QPainterPath path;
path.addRect(rect); path.addRect(rect);