Skip to content

Commit

Permalink
Fix for PAL label vertical offset
Browse files Browse the repository at this point in the history
- 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 0bd9bfb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/qgspallabeling.cpp
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 0bd9bfb

Please sign in to comment.