Skip to content

Commit

Permalink
Fix rendering of WMS Legend Graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Sep 1, 2014
1 parent 05b01c1 commit 45d6584
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/core/composer/qgscomposerlegenditem.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class CORE_EXPORT QgsComposerLegendItem: public QStandardItem
{
GroupItem = QStandardItem::UserType,
LayerItem,
// TODO: unify all item types derived from BaseSymbol item under one value (to allow extensibility)
SymbologyV2Item,
RasterSymbolItem,
RasterImageItem,
Expand Down
10 changes: 7 additions & 3 deletions src/core/qgslegendrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ void QgsLegendRenderer::setColumns( QList<Atom>& atomList )
if ( !item ) continue;
QgsComposerLegendItem::ItemType type = item->itemType();
if ( type == QgsComposerLegendItem::SymbologyV2Item ||
type == QgsComposerLegendItem::RasterSymbolItem )
type == QgsComposerLegendItem::RasterSymbolItem ||
type == QgsComposerLegendItem::RasterImageItem )
{
QString key = QString( "%1-%2" ).arg(( qulonglong )item->parent() ).arg( atomList[i].column );
maxSymbolWidth[key] = qMax( atomList[i].nucleons[j].symbolSize.width(), maxSymbolWidth[key] );
Expand All @@ -324,7 +325,8 @@ void QgsLegendRenderer::setColumns( QList<Atom>& atomList )
if ( !item ) continue;
QgsComposerLegendItem::ItemType type = item->itemType();
if ( type == QgsComposerLegendItem::SymbologyV2Item ||
type == QgsComposerLegendItem::RasterSymbolItem )
type == QgsComposerLegendItem::RasterSymbolItem ||
type == QgsComposerLegendItem::RasterImageItem )
{
QString key = QString( "%1-%2" ).arg(( qulonglong )item->parent() ).arg( atomList[i].column );
double space = mSettings.style( QgsComposerLegendStyle::Symbol ).margin( QgsComposerLegendStyle::Right ) +
Expand Down Expand Up @@ -425,6 +427,7 @@ double QgsLegendRenderer::spaceAboveAtom( Atom atom )
break;
case QgsComposerLegendItem::SymbologyV2Item:
case QgsComposerLegendItem::RasterSymbolItem:
case QgsComposerLegendItem::RasterImageItem:
// TODO: use Symbol or SymbolLabel Top margin
return mSettings.style( QgsComposerLegendStyle::Symbol ).margin( QgsComposerLegendStyle::Top );
break;
Expand Down Expand Up @@ -473,7 +476,8 @@ QSizeF QgsLegendRenderer::drawAtom( Atom atom, QPainter* painter, QPointF point
}
}
else if ( type == QgsComposerLegendItem::SymbologyV2Item ||
type == QgsComposerLegendItem::RasterSymbolItem )
type == QgsComposerLegendItem::RasterSymbolItem ||
type == QgsComposerLegendItem::RasterImageItem )
{
if ( !first )
{
Expand Down

0 comments on commit 45d6584

Please sign in to comment.