Skip to content
Permalink
Browse files

Merge pull request #8345 from m-kuhn/snapToGridExtentsUpdate

Update snap to grid rect on extentChange
  • Loading branch information
m-kuhn committed Oct 26, 2018
2 parents a0e3c2d + 0a80814 commit 03c38e92f88559117bdeb106c7a255bca692f9b3
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 03c38e9

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