Skip to content

Commit

Permalink
Merge pull request #1180 from nirvn/legend_spacing_fix2
Browse files Browse the repository at this point in the history
[composer] fix vertical spacing of hidden layer title in legend items (fix #9498)
  • Loading branch information
NathanW2 committed Feb 17, 2014
2 parents d31b595 + d102a79 commit ef5ede1
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/core/composer/qgscomposerlegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ QSizeF QgsComposerLegend::drawLayerItemTitle( QgsComposerLayerItem* layerItem, Q
if ( !layerItem ) return size;

//Let the user omit the layer title item by having an empty layer title string
if ( layerItem->text().isEmpty() ) return size;
if ( layerItem->text().isEmpty() || layerItem->style() == QgsComposerLegendStyle::Hidden ) return size;

double y = point.y();

Expand Down Expand Up @@ -805,15 +805,12 @@ QList<QgsComposerLegend::Atom> QgsComposerLegend::createAtomList( QStandardItem*
{
Atom atom;

if ( currentLegendItem->style() != QgsComposerLegendStyle::Hidden )
{
Nucleon nucleon;
nucleon.item = currentLegendItem;
nucleon.size = drawLayerItemTitle( dynamic_cast<QgsComposerLayerItem*>( currentLegendItem ) );
atom.nucleons.append( nucleon );
atom.size.rwidth() = nucleon.size.width();
atom.size.rheight() = nucleon.size.height();
}
Nucleon nucleon;
nucleon.item = currentLegendItem;
nucleon.size = drawLayerItemTitle( dynamic_cast<QgsComposerLayerItem*>( currentLegendItem ) );
atom.nucleons.append( nucleon );
atom.size.rwidth() = nucleon.size.width();
atom.size.rheight() = nucleon.size.height();

QList<Atom> layerAtoms;

Expand Down

0 comments on commit ef5ede1

Please sign in to comment.