mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-30 00:29:39 -05:00
Reorganise conditions
This commit is contained in:
parent
255bb225b6
commit
026e8c1efe
@ -354,7 +354,17 @@ bool QgsCurve::snapToGridPrivate( double hSpacing, double vSpacing, double dSpac
|
||||
const double roundedZ = hasZ && dSpacing > 0 ? ( std::round( currentZ / dSpacing ) * dSpacing ) : currentZ;
|
||||
const double roundedM = hasM && mSpacing > 0 ? ( std::round( currentM / mSpacing ) * mSpacing ) : currentM;
|
||||
|
||||
if ( i > 0 )
|
||||
if ( i == 0 )
|
||||
{
|
||||
outX.append( roundedX );
|
||||
outY.append( roundedY );
|
||||
if ( hasZ )
|
||||
outZ.append( roundedZ );
|
||||
if ( hasM )
|
||||
outM.append( roundedM );
|
||||
outSize++;
|
||||
}
|
||||
else
|
||||
{
|
||||
const bool isPointEqual = qgsDoubleNear( roundedX, previousX )
|
||||
&& qgsDoubleNear( roundedY, previousY )
|
||||
@ -389,16 +399,6 @@ bool QgsCurve::snapToGridPrivate( double hSpacing, double vSpacing, double dSpac
|
||||
outSize++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outX.append( roundedX );
|
||||
outY.append( roundedY );
|
||||
if ( hasZ )
|
||||
outZ.append( roundedZ );
|
||||
if ( hasM )
|
||||
outM.append( roundedM );
|
||||
outSize++;
|
||||
}
|
||||
|
||||
previousX = roundedX;
|
||||
previousY = roundedY;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user