From 15ba0064088559124741a04ae4603048f6b8ccb6 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 1 Jun 2015 07:05:35 +1000 Subject: [PATCH] [labeling] Fix broken repeat distance in map units (fix #11937) --- src/core/qgspallabeling.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index 2f54b644736..f5d1e664708 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -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