Skip to content

Commit aa95881

Browse files
committed
Snap to grid to sub unit resolution
When the grid was smaller than 1 map unit, qgis would just freeze. ouch
1 parent 85ff90f commit aa95881

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gui/qgssnaptogridcanvasitem.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ void QgsSnapToGridCanvasItem::paint( QPainter *painter )
5353
const double gridYMin = std::ceil( layerExtent.yMinimum() / mPrecision ) * mPrecision;
5454
const double gridYMax = std::ceil( layerExtent.yMaximum() / mPrecision ) * mPrecision;
5555

56-
for ( int x = gridXMin ; x < gridXMax; x += mPrecision )
56+
for ( double x = gridXMin ; x < gridXMax; x += mPrecision )
5757
{
58-
for ( int y = gridYMin ; y < gridYMax; y += mPrecision )
58+
for ( double y = gridYMin ; y < gridYMax; y += mPrecision )
5959
{
6060
const QgsPointXY pt = mTransform.transform( x, y );
6161
const QPointF canvasPt = toCanvasCoordinates( pt );

0 commit comments

Comments
 (0)