mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Tweak vertical position of labels under points in "cartographic"
label placement mode Previously labels were being drawn too low
This commit is contained in:
parent
75d6a19ae8
commit
58c85bb8c0
@ -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 |
BIN
tests/testdata/labeling/pal_features_v3.sqlite
vendored
BIN
tests/testdata/labeling/pal_features_v3.sqlite
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user