Skip to content
Permalink
Browse files

composer legend single column box width fix

  • Loading branch information
blazek committed Nov 17, 2012
1 parent 2ddc753 commit 724f190cc6b62da38339a4df3eef29fc70b2ca0a
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/core/composer/qgscomposerlegend.cpp
@@ -301,7 +301,9 @@ QgsComposerLegend::LegendSize QgsComposerLegend::paintAndDetermineSize( QPainter
{
double currentYCoord = mBoxSpace;

// center if we stay in totalWidth, otherwise allign to left and expand total width
// For multicolumn center if we stay in totalWidth, otherwise allign to left
// and expand total width. With single column keep alligned to left be cause
// it looks better alligned with items bellow instead of centered
Qt::AlignmentFlag halignement;
if ( mColumnCount > 1 && currentPosition.titleSize.width() + 2 * mBoxSpace < totalWidth )
{
@@ -310,7 +312,7 @@ QgsComposerLegend::LegendSize QgsComposerLegend::paintAndDetermineSize( QPainter
else
{
halignement = Qt::AlignLeft;
totalWidth = currentPosition.titleSize.width() + 2 * mBoxSpace;
totalWidth = qMax( currentPosition.titleSize.width() + 2 * mBoxSpace, totalWidth );
}

if ( painter ) painter->setPen( QColor( 0, 0, 0 ) );

0 comments on commit 724f190

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