mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Scale the painter, not the images for performance reasons
This commit is contained in:
parent
33f2002a52
commit
97dbfb163b
@ -227,9 +227,13 @@ void RasterTile::drawPolygons(QPainter *painter)
|
||||
|
||||
SubFile::Handle hdl(poly.raster.lbl());
|
||||
QImage img(poly.raster.lbl()->readImage(hdl, poly.raster.id()));
|
||||
qreal sx = (qreal)size.width() / (qreal)img.width();
|
||||
qreal sy = (qreal)size.height() / (qreal)img.height();
|
||||
|
||||
painter->drawImage(tl, img.scaled(size, Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation));
|
||||
painter->save();
|
||||
painter->scale(sx, sy);
|
||||
painter->drawImage(QPointF(tl.x() / sx, tl.y() / sy), img);
|
||||
painter->restore();
|
||||
|
||||
//painter->setPen(Qt::blue);
|
||||
//painter->setBrush(Qt::NoBrush);
|
||||
|
Loading…
Reference in New Issue
Block a user