Skip to content
Browse files
Tweak vertical position of labels under points in "cartographic"
label placement mode

Previously labels were being drawn too low
  • Loading branch information
nyalldawson committed Feb 26, 2016
1 parent 75d6a19 commit 58c85bb8c0ec5bb03f01eb6adfd9049b79e04df2
@@ -2695,7 +2695,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, QgsRenderContext &cont

//set label's visual margin so that top visual margin is the leading, and bottom margin is the font's descent
//this makes labels align to the font's baseline or highest character
double topMargin = qMax( labelFontMetrics->leading(), 0.0 ) + 1.0;
double topMargin = qMax( 0.25 * labelFontMetrics->ascent(), 0.0 );
double bottomMargin = 1.0 + labelFontMetrics->descent();
QgsLabelFeature::VisualMargin vm( topMargin, 0.0, bottomMargin, 0.0 );
vm *= xform->mapUnitsPerPixel() / rasterCompressFactor;
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 58c85bb

Please sign in to comment.