Skip to content

Commit 08c8857

Browse files
author
mhugent
committed
Follow up for #3605
git-svn-id: http://svn.osgeo.org/qgis/trunk@15604 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent ccee31f commit 08c8857

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/composer/qgscomposerlegend.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ void QgsComposerLegend::drawLayerItem( QPainter* p, QgsComposerLayerItem* layerI
200200
}
201201

202202
//Let the user omit the layer title item by having an empty layer title string
203-
currentYCoord += mLayerSpace;
204203
if ( !layerItem->text().isEmpty() )
205204
{
205+
currentYCoord += mLayerSpace;
206206
currentYCoord += fontAscentMillimeters( mLayerFont );
207207

208208
//draw layer Item
@@ -214,6 +214,12 @@ void QgsComposerLegend::drawLayerItem( QPainter* p, QgsComposerLayerItem* layerI
214214

215215
maxXCoord = qMax( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mLayerFont, layerItem->text() ) );
216216
}
217+
else //layer title omited
218+
{
219+
//symbol space will be added before the item later
220+
currentYCoord += (mLayerSpace - mSymbolSpace);
221+
}
222+
217223
//and child items
218224
drawLayerChildItems( p, layerItem, currentYCoord, maxXCoord, opacity );
219225
}

0 commit comments

Comments
 (0)