@@ -101,7 +101,6 @@ QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
101
101
drawText ( painter, mBoxSpace , currentYCoordinate, mTitle , mTitleFont );
102
102
}
103
103
104
-
105
104
maxXCoord = 2 * mBoxSpace + textWidthMillimeters ( mTitleFont , mTitle );
106
105
107
106
double currentItemMaxX = 0 ; // maximum x-coordinate for current item
@@ -114,13 +113,13 @@ QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
114
113
QgsComposerLegendItem::ItemType type = currentLegendItem->itemType ();
115
114
if ( type == QgsComposerLegendItem::GroupItem )
116
115
{
117
- drawGroupItem ( painter, dynamic_cast <QgsComposerGroupItem*>( currentLegendItem ), currentYCoordinate, currentItemMaxX );
118
- maxXCoord = qMax ( maxXCoord, currentItemMaxX );
116
+ drawGroupItem ( painter, dynamic_cast <QgsComposerGroupItem*>( currentLegendItem ), currentYCoordinate, currentMaxXCoord );
117
+ maxXCoord = qMax ( maxXCoord, currentMaxXCoord );
119
118
}
120
119
else if ( type == QgsComposerLegendItem::LayerItem )
121
120
{
122
- drawLayerItem ( painter, dynamic_cast <QgsComposerLayerItem*>( currentLegendItem ), currentYCoordinate, currentItemMaxX );
123
- maxXCoord = qMax ( maxXCoord, currentItemMaxX );
121
+ drawLayerItem ( painter, dynamic_cast <QgsComposerLayerItem*>( currentLegendItem ), currentYCoordinate, currentMaxXCoord );
122
+ maxXCoord = qMax ( maxXCoord, currentMaxXCoord );
124
123
}
125
124
}
126
125
}
0 commit comments