Skip to content

Commit

Permalink
Use flat caps for line symbols in composer legend
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12188 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 19, 2009
1 parent a953e93 commit eca59fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/core/composer/qgscomposerlegend.cpp
Expand Up @@ -75,7 +75,7 @@ QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
{
painter->save();
drawBackground( painter );
painter->setPen( QPen( QColor( 0, 0, 0 ) ) ); //draw all text black
painter->setPen( QPen( QColor( 0, 0, 0 ) ) );
}

int numLayerItems = rootItem->rowCount();
Expand Down Expand Up @@ -326,6 +326,7 @@ void QgsComposerLegend::drawLineSymbol( QPainter* p, QgsSymbol* s, double curren
QColor penColor = symbolPen.color();
penColor.setAlpha( opacity );
symbolPen.setColor( penColor );
symbolPen.setCapStyle( Qt::FlatCap );
p->setPen( symbolPen );
p->drawLine( QPointF( currentXPosition, yCoord ), QPointF( currentXPosition + mSymbolWidth, yCoord ) );
p->restore();
Expand Down
5 changes: 0 additions & 5 deletions src/core/composer/qgscomposerpicture.cpp
Expand Up @@ -101,11 +101,6 @@ void QgsComposerPicture::paint( QPainter* painter, const QStyleOptionGraphicsIte
painter->rotate( mRotation );
painter->translate( -rotatedBoundImageWidthMM / 2.0, -rotatedBoundImageHeightMM / 2.0 );

/*if ( mComposition && mComposition->plotStyle() == QgsComposition::Preview )
{
rotatedBoundImageWidthMM /= std::min( viewScaleFactor, 10.0 );
rotatedBoundImageHeightMM /= std::min( viewScaleFactor, 10.0 );
}*/
painter->drawImage( QRectF( 0, 0, rotatedBoundImageWidthMM, rotatedBoundImageHeightMM ), mImage, QRectF( 0, 0, mImage.width(), mImage.height() ) );

painter->restore();
Expand Down

0 comments on commit eca59fd

Please sign in to comment.