Skip to content

Commit acf0f41

Browse files
author
mhugent
committedNov 15, 2008

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed
 

‎src/core/composer/qgscomposerlegend.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,18 @@ QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
9797
currentLayerItem = rootItem->child( i );
9898
if ( currentLayerItem )
9999
{
100-
currentYCoordinate += mLayerSpace;
101-
currentYCoordinate += fontAscentMillimeters( mLayerFont );
102-
103-
//draw layer Item
104-
if ( painter )
105-
{
106-
drawText( painter, mBoxSpace, currentYCoordinate, currentLayerItem->text(), mLayerFont );
107-
}
100+
//Let the user omit the layer title item by having an empty layer title string
101+
if(!currentLayerItem->text().isEmpty())
102+
{
103+
currentYCoordinate += mLayerSpace;
104+
currentYCoordinate += fontAscentMillimeters( mLayerFont );
105+
106+
//draw layer Item
107+
if ( painter )
108+
{
109+
drawText( painter, mBoxSpace, currentYCoordinate, currentLayerItem->text(), mLayerFont );
110+
}
111+
}
108112

109113
maxXCoord = std::max( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mLayerFont, currentLayerItem->text() ) );
110114

0 commit comments

Comments
 (0)
Please sign in to comment.