Skip to content

Commit

Permalink
Fix small jumps of the map canvas image after panning
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jun 17, 2014
1 parent ae96568 commit a745127
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,11 @@ QgsMapCanvas::QgsMapCanvas( QWidget * parent, const char *name )
// it is parented to map canvas, will be deleted automatically
new QgsMapCanvasRendererSync( this, mMapRenderer );

mSettings.setOutputSize( size() );
mMapRenderer->setOutputSize( size(), mSettings.outputDpi() );
setSceneRect( 0, 0, size().width(), size().height() );
mScene->setSceneRect( QRectF( 0, 0, size().width(), size().height() ) );
QSize s = viewport()->size();
mSettings.setOutputSize( s );
mMapRenderer->setOutputSize( s, mSettings.outputDpi() );
setSceneRect( 0, 0, s.width(), s.height() );
mScene->setSceneRect( QRectF( 0, 0, s.width(), s.height() ) );

moveCanvasContents( true );

Expand Down Expand Up @@ -1220,7 +1221,7 @@ void QgsMapCanvas::resizeEvent( QResizeEvent * e )
QGraphicsView::resizeEvent( e );
mResizeTimer->start( 500 );

QSize lastSize = size();
QSize lastSize = viewport()->size();

mSettings.setOutputSize( lastSize );
mMapRenderer->setOutputSize( lastSize, mSettings.outputDpi() );
Expand Down Expand Up @@ -1644,7 +1645,7 @@ void QgsMapCanvas::moveCanvasContents( bool reset )
if ( !reset )
pnt += mCanvasProperties->mouseLastXY - mCanvasProperties->rubberStartPoint;

setSceneRect( -pnt.x(), -pnt.y(), size().width(), size().height() );
setSceneRect( -pnt.x(), -pnt.y(), viewport()->size().width(), viewport()->size().height() );
}

void QgsMapCanvas::showError( QgsMapLayer * mapLayer )
Expand Down

0 comments on commit a745127

Please sign in to comment.