Skip to content

Commit 58c85bb

Browse files
committedFeb 26, 2016
Tweak vertical position of labels under points in "cartographic"
label placement mode Previously labels were being drawn too low
1 parent 75d6a19 commit 58c85bb

File tree

4 files changed

+1
-1
lines changed

4 files changed

+1
-1
lines changed
 

‎src/core/qgspallabeling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2695,7 +2695,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, QgsRenderContext &cont
26952695

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

0 commit comments

Comments
 (0)
Please sign in to comment.