We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
2 parents a0e3c2d + 0a80814 commit 03c38e9Copy full SHA for 03c38e9
src/gui/qgssnaptogridcanvasitem.cpp
@@ -31,8 +31,6 @@ void QgsSnapToGridCanvasItem::paint( QPainter *painter )
31
32
painter->save();
33
QgsRectangle mapRect = mMapCanvas->extent();
34
- if ( rect() != mapRect )
35
- setRect( mapRect );
36
37
painter->setRenderHints( QPainter::Antialiasing );
38
painter->setCompositionMode( QPainter::CompositionMode_Difference );
@@ -145,6 +143,10 @@ void QgsSnapToGridCanvasItem::updateZoomFactor()
145
143
{
146
144
const int threshold = 5;
147
+ const QgsRectangle extent = mMapCanvas->extent();
+ if ( extent != rect() )
148
+ setRect( extent );
149
+
150
const QgsPointXY centerPoint = mMapCanvas->extent().center();
151
const QPointF canvasCenter = toCanvasCoordinates( centerPoint );
152
0 commit comments