Skip to content
Permalink
Browse files

Fix #12151 - fix cached composer map image when zoomed in a lot

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 70a0a6e3afa3c789866491b5e9ce71a22a874af8
Showing with 12 additions and 7 deletions.
  1. +12 −7 src/core/composer/qgscomposermap.cpp
@@ -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 );

0 comments on commit 70a0a6e

Please sign in to comment.
You can’t perform that action at this time.