Skip to content

Commit eca59fd

Browse files
author
mhugent
committed
Use flat caps for line symbols in composer legend
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12188 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a953e93 commit eca59fd

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/core/composer/qgscomposerlegend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
7575
{
7676
painter->save();
7777
drawBackground( painter );
78-
painter->setPen( QPen( QColor( 0, 0, 0 ) ) ); //draw all text black
78+
painter->setPen( QPen( QColor( 0, 0, 0 ) ) );
7979
}
8080

8181
int numLayerItems = rootItem->rowCount();
@@ -326,6 +326,7 @@ void QgsComposerLegend::drawLineSymbol( QPainter* p, QgsSymbol* s, double curren
326326
QColor penColor = symbolPen.color();
327327
penColor.setAlpha( opacity );
328328
symbolPen.setColor( penColor );
329+
symbolPen.setCapStyle( Qt::FlatCap );
329330
p->setPen( symbolPen );
330331
p->drawLine( QPointF( currentXPosition, yCoord ), QPointF( currentXPosition + mSymbolWidth, yCoord ) );
331332
p->restore();

src/core/composer/qgscomposerpicture.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ void QgsComposerPicture::paint( QPainter* painter, const QStyleOptionGraphicsIte
101101
painter->rotate( mRotation );
102102
painter->translate( -rotatedBoundImageWidthMM / 2.0, -rotatedBoundImageHeightMM / 2.0 );
103103

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

111106
painter->restore();

0 commit comments

Comments
 (0)