Skip to content

Commit 40e0d78

Browse files
author
Sandro Santilli
committed
Fix glitch on mouse-wheel zoom event
See http://hub.qgis.org/issues/11811
1 parent ea33122 commit 40e0d78

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/gui/qgsmapcanvasmap.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ void QgsMapCanvasMap::paint( QPainter* painter )
5050
if ( mImage.size() != QSize( w, h ) )
5151
{
5252
QgsDebugMsg( QString( "map paint DIFFERENT SIZE: img %1,%2 item %3,%4" ).arg( mImage.width() ).arg( mImage.height() ).arg( w ).arg( h ) );
53+
}
54+
55+
// TODO: this is an hack, we should instead make sure that
56+
// the image passed here from QgsMapCanvas, via setContent,
57+
// is pre-clipped in case of rotation.
58+
// See http://hub.qgis.org/issues/11811
59+
if ( ( mImage.width() > w && mImage.height() < h ) ||
60+
( mImage.height() > h && mImage.width() < w ) ) {
5361
int tX = ( w - mImage.width() ) / 2.0;
5462
int tY = ( h - mImage.height() ) / 2.0;
5563
int fX = 0;

0 commit comments

Comments
 (0)