Skip to content
Permalink
Browse files

Update snap to grid rect on extentChange

Fix #20222
  • Loading branch information
m-kuhn committed Oct 26, 2018
1 parent a0e3c2d commit 0a8081416f32a61891c08953f902c0162c52f640
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gui/qgssnaptogridcanvasitem.cpp
@@ -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 );
@@ -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 );

0 comments on commit 0a80814

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