Skip to content

Commit

Permalink
Fix #12151 - fix cached composer map image when zoomed in a lot
Browse files Browse the repository at this point in the history
The map was being rendered with wrong parameters when width or height
exceeded 5000 pixels.
  • Loading branch information
wonder-sk committed Feb 17, 2015
1 parent b3a4ace commit 70a0a6e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -270,14 +270,19 @@ void QgsComposerMap::cache( void )
int w = widthMM * horizontalVScaleFactor;
int h = heightMM * horizontalVScaleFactor;

if ( w > 5000 ) //limit size of image for better performance
// limit size of image for better performance
if ( w > 5000 || h > 5000 )
{
w = 5000;
}

if ( h > 5000 )
{
h = 5000;
if ( w > h )
{
w = 5000;
h = w * heightMM / widthMM;
}
else
{
h = 5000;
w = h * widthMM / heightMM;
}
}

mCacheImage = QImage( w, h, QImage::Format_ARGB32 );
Expand Down

0 comments on commit 70a0a6e

Please sign in to comment.