Skip to content

Commit

Permalink
[labeling] Fix broken repeat distance in map units (fix #11937)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 31, 2015
1 parent c550af2 commit 15ba006
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/core/qgspallabeling.cpp
Expand Up @@ -2127,17 +2127,12 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
}
}

if ( repeatDist != 0 )
if ( !qgsDoubleNear( repeatDist, 0.0 ) )
{
if ( repeatdistinmapunit ) //convert distance from mm/map units to pixels
if ( !repeatdistinmapunit )
{
repeatDist /= repeatDistanceMapUnitScale.computeMapUnitsPerPixel( context ) * context.scaleFactor();
repeatDist *= mapUntsPerMM; //convert repeat distance from mm to map units
}
else //mm
{
repeatDist *= vectorScaleFactor;
}
repeatDist *= qAbs( ptOne.x() - ptZero.x() );
}

// feature to the layer
Expand Down

0 comments on commit 15ba006

Please sign in to comment.