Skip to content
Permalink
Browse files

Fix rendering of WMS Legend Graphics

  • Loading branch information
wonder-sk committed Sep 1, 2014
1 parent 05b01c1 commit 45d65849bcf7587a7c3a4a9dcff2b1dc049ed785
Showing with 8 additions and 3 deletions.
  1. +1 −0 src/core/composer/qgscomposerlegenditem.h
  2. +7 −3 src/core/qgslegendrenderer.cpp
@@ -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,
@@ -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] );
@@ -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 ) +
@@ -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;
@@ -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 )
{

0 comments on commit 45d6584

Please sign in to comment.
You can’t perform that action at this time.