Tweak vertical position of labels under points in "cartographic"

label placement mode

Previously labels were being drawn too low
This commit is contained in:
Nyall Dawson 2016-02-26 19:35:02 +11:00
parent 75d6a19ae8
commit 58c85bb8c0
4 changed files with 1 additions and 1 deletions

View File

@ -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.

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.