mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-11-24 03:35:54 +01:00
Fixed broken down-scaling
This commit is contained in:
parent
3f6b5faa2c
commit
aacc42c25d
@ -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);
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user