Skip to content

Commit

Permalink
[composer] fix vertical spacing of hidden layer title in legend items (
Browse files Browse the repository at this point in the history
…fix #9498)
  • Loading branch information
nirvn committed Feb 16, 2014
1 parent 1607759 commit d102a79
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/core/composer/qgscomposerlegend.cpp
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 d102a79

Please sign in to comment.