Skip to content

Commit

Permalink
Merge pull request #8345 from m-kuhn/snapToGridExtentsUpdate
Browse files Browse the repository at this point in the history
Update snap to grid rect on extentChange
  • Loading branch information
m-kuhn committed Oct 26, 2018
2 parents a0e3c2d + 0a80814 commit 03c38e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgssnaptogridcanvasitem.cpp
Expand Up @@ -31,8 +31,6 @@ void QgsSnapToGridCanvasItem::paint( QPainter *painter )

painter->save();
QgsRectangle mapRect = mMapCanvas->extent();
if ( rect() != mapRect )
setRect( mapRect );

painter->setRenderHints( QPainter::Antialiasing );
painter->setCompositionMode( QPainter::CompositionMode_Difference );
Expand Down Expand Up @@ -145,6 +143,10 @@ void QgsSnapToGridCanvasItem::updateZoomFactor()
{
const int threshold = 5;

const QgsRectangle extent = mMapCanvas->extent();
if ( extent != rect() )
setRect( extent );

const QgsPointXY centerPoint = mMapCanvas->extent().center();
const QPointF canvasCenter = toCanvasCoordinates( centerPoint );

Expand Down

0 comments on commit 03c38e9

Please sign in to comment.