mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 13:41:16 +01:00
Broken OpenGL image part drawing workaround
This commit is contained in:
parent
3b2d4dcd31
commit
d4b46a4bb6
@ -79,7 +79,12 @@ void GeoTIFFMap::draw(QPainter *painter, const QRectF &rect, bool block)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(block)
|
Q_UNUSED(block)
|
||||||
|
|
||||||
if (_img && !_img->isNull())
|
if (_img && !_img->isNull()) {
|
||||||
painter->drawImage(rect.topLeft(), *_img, QRectF(rect.topLeft()
|
/* Drawing directly a sub-rectangle without an image copy does not work
|
||||||
* _ratio, rect.size() * _ratio));
|
for big images under OpenGL. The image is most probably loaded as
|
||||||
|
whole which exceeds the texture size limit. */
|
||||||
|
QRectF sr(rect.topLeft() * _ratio, rect.size() * _ratio);
|
||||||
|
QImage img(_img->copy(sr.toRect()));
|
||||||
|
painter->drawImage(rect.topLeft(), img);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,8 +302,12 @@ void OziMap::drawOZF(QPainter *painter, const QRectF &rect) const
|
|||||||
|
|
||||||
void OziMap::drawImage(QPainter *painter, const QRectF &rect) const
|
void OziMap::drawImage(QPainter *painter, const QRectF &rect) const
|
||||||
{
|
{
|
||||||
painter->drawImage(rect.topLeft(), *_img, QRectF(rect.topLeft() * _ratio,
|
/* Drawing directly a sub-rectangle without an image copy does not work
|
||||||
rect.size() * _ratio));
|
for big images under OpenGL. The image is most probably loaded as
|
||||||
|
whole which exceeds the texture size limit. */
|
||||||
|
QRectF sr(rect.topLeft() * _ratio, rect.size() * _ratio);
|
||||||
|
QImage img(_img->copy(sr.toRect()));
|
||||||
|
painter->drawImage(rect.topLeft(), img);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OziMap::draw(QPainter *painter, const QRectF &rect, bool block)
|
void OziMap::draw(QPainter *painter, const QRectF &rect, bool block)
|
||||||
|
Loading…
Reference in New Issue
Block a user