Skip to content

Commit

Permalink
Tweak vertical position of labels under points in "cartographic"
Browse files Browse the repository at this point in the history
label placement mode

Previously labels were being drawn too low
  • Loading branch information
nyalldawson committed Feb 26, 2016
1 parent 75d6a19 commit 58c85bb
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.cpp
Expand Up @@ -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;
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/testdata/labeling/pal_features_v3.sqlite
Binary file not shown.

0 comments on commit 58c85bb

Please sign in to comment.