Skip to content
Permalink
Browse files

Merge pull request #7885 from m-kuhn/subUnitRes

Snap to grid to sub unit resolution
  • Loading branch information
m-kuhn committed Sep 13, 2018
2 parents e22939e + aa95881 commit 23f1e43c2b93956425aa73e506be5c14a28ee0a1
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gui/qgssnaptogridcanvasitem.cpp
@@ -53,9 +53,9 @@ void QgsSnapToGridCanvasItem::paint( QPainter *painter )
const double gridYMin = std::ceil( layerExtent.yMinimum() / mPrecision ) * mPrecision;
const double gridYMax = std::ceil( layerExtent.yMaximum() / mPrecision ) * mPrecision;

for ( int x = gridXMin ; x < gridXMax; x += mPrecision )
for ( double x = gridXMin ; x < gridXMax; x += mPrecision )
{
for ( int y = gridYMin ; y < gridYMax; y += mPrecision )
for ( double y = gridYMin ; y < gridYMax; y += mPrecision )
{
const QgsPointXY pt = mTransform.transform( x, y );
const QPointF canvasPt = toCanvasCoordinates( pt );

0 comments on commit 23f1e43

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