Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Small fixes to set a minimum starting size for the legend font and to
make the polygon legend's border match the polygon's.


git-svn-id: http://svn.osgeo.org/qgis/trunk@7218 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
StevenB authored and StevenB committed Sep 24, 2007
1 parent 2b901b1 commit e916ad4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/composer/qgscomposervectorlegend.cpp
Expand Up @@ -48,7 +48,10 @@ QgsComposerVectorLegend::QgsComposerVectorLegend ( QgsComposition *composition,

init();

// Font and pen
// Font and pen
if(fontSize < 6){
fontSize = 6;
}
mFont.setPointSize ( fontSize );

// Set map to the first available if any
Expand Down Expand Up @@ -160,6 +163,7 @@ QRectF QgsComposerVectorLegend::render ( QPainter *p )
}

std::cout << "mComposition->scale() = " << mComposition->scale() << std::endl;

// Font size in canvas units
float titleSize = 25.4 * mComposition->scale() * mTitleFont.pointSizeFloat() / 72;
float sectionSize = 25.4 * mComposition->scale() * mSectionFont.pointSizeFloat() / 72;
Expand Down Expand Up @@ -393,7 +397,7 @@ std::cout << "widthScale: " << widthScale << std::endl;
painter->drawLine ( mMargin, localHeight+mSymbolHeight/2,
mMargin+mSymbolWidth, localHeight+mSymbolHeight/2 );
} else if ( vector->vectorType() == QGis::Polygon ) {
pen.setWidth(0); //use a cosmetic pen to outline the fill box
//pen.setWidth(0); //use a cosmetic pen to outline the fill box
pen.setCapStyle(Qt::FlatCap);
painter->setPen ( pen );
painter->drawRect ( mMargin, localHeight, mSymbolWidth, mSymbolHeight );
Expand Down

0 comments on commit e916ad4

Please sign in to comment.