mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-11-23 19:25:55 +01:00
Keep the overzoom and scaled size separated
This commit is contained in:
parent
d5c315efbe
commit
8261ee2e79
@ -83,10 +83,12 @@ bool PBFHandler::read(QImage *image)
|
||||
int zoom = list.size() ? list.first().toInt() : 0;
|
||||
int overzoom = (list.size() > 1) ? list.at(1).toInt() : 0;
|
||||
|
||||
QSize size = _scaledSize.isValid()
|
||||
? _scaledSize : QSize(TILE_SIZE, TILE_SIZE);
|
||||
QPointF scale((qreal)size.width() / (TILE_SIZE << overzoom),
|
||||
(qreal)size.height() / (TILE_SIZE << overzoom));
|
||||
QSize scaledSize(_scaledSize.isValid()
|
||||
? _scaledSize : QSize(TILE_SIZE, TILE_SIZE));
|
||||
QSize size(scaledSize.width()<<overzoom,
|
||||
scaledSize.height()<<overzoom);
|
||||
QPointF scale((qreal)scaledSize.width() / TILE_SIZE,
|
||||
(qreal)scaledSize.height() / TILE_SIZE);
|
||||
|
||||
*image = QImage(size, QImage::Format_ARGB32_Premultiplied);
|
||||
Tile tile(image, zoom, scale);
|
||||
|
Loading…
Reference in New Issue
Block a user