Skip to content
Permalink
Browse files

Fix for PAL label vertical offset

- Corrected vertical alignment offset for all labels
- Curved and parallel line labels also now register well for above/on/below
  • Loading branch information
dakcarto committed Sep 16, 2012
1 parent 9a68328 commit 0bd9bfbb1894eb18ccd9c3b9b1d8223c55562d5d
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/qgspallabeling.cpp
@@ -1726,8 +1726,9 @@ void QgsPalLabeling::drawLabel( pal::LabelPosition* label, QPainter* painter, co
painter->scale( 1.0 / lyr.rasterCompressFactor, 1.0 / lyr.rasterCompressFactor );

double yMultiLineOffset = ( multiLineList.size() - 1 - i ) * lyr.fontMetrics->height();
// yMultiLineOffset += lyr.fontMetrics->descent();
painter->translate( QPointF( 0, -yMultiLineOffset ) );
double ascentOffset = 0.0;
ascentOffset = lyr.fontMetrics->height() * 0.25 * lyr.fontMetrics->ascent() / lyr.fontMetrics->height();
painter->translate( QPointF( 0, - ascentOffset - yMultiLineOffset ) );

if ( drawBuffer )
{

0 comments on commit 0bd9bfb

Please sign in to comment.
You can’t perform that action at this time.