Skip to content
Permalink
Browse files
Merge branch 'release-1_7_0' of github.com:qgis/Quantum-GIS into rele…
…ase-1_7_0
  • Loading branch information
timlinux committed Aug 10, 2011
2 parents ddff554 + e5e4a81 commit a489b15fea9758aa765826c64b2c6583329c2a10
Showing with 14 additions and 2 deletions.
  1. +14 −2 src/core/composer/qgscomposerlegend.cpp
@@ -404,6 +404,9 @@ void QgsComposerLegend::drawSymbolV2( QPainter* p, QgsSymbolV2* s, double curren
double height = mSymbolHeight;
double width = mSymbolWidth;
double size = 0;
//Center small marker symbols
double widthOffset = 0;
double heightOffset = 0;

if ( markerSymbol )
{
@@ -416,10 +419,18 @@ void QgsComposerLegend::drawSymbolV2( QPainter* p, QgsSymbolV2* s, double curren
width *= mmPerMapUnit;
markerSymbol->setSize( width );
}
if ( width < mSymbolWidth )
{
widthOffset = ( mSymbolWidth - width ) / 2.0;
}
if ( height < mSymbolHeight )
{
heightOffset = ( mSymbolHeight - height ) / 2.0;
}
}

p->save();
p->translate( currentXPosition, currentYCoord );
p->translate( currentXPosition + widthOffset, currentYCoord + heightOffset );
p->scale( 1.0 / rasterScaleFactor, 1.0 / rasterScaleFactor );

if ( markerSymbol && sizeInMapUnits )
@@ -436,7 +447,8 @@ void QgsComposerLegend::drawSymbolV2( QPainter* p, QgsSymbolV2* s, double curren

p->restore();
currentXPosition += width;
symbolHeight = height;
currentXPosition += 2 * widthOffset;
symbolHeight = height + 2 * heightOffset;
}

void QgsComposerLegend::drawPointSymbol( QPainter* p, QgsSymbol* s, double currentYCoord, double& currentXPosition, double& symbolHeight, int opacity ) const

0 comments on commit a489b15

Please sign in to comment.