Skip to content
Permalink
Browse files
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/qgis@7218 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
StevenB authored and StevenB committed Sep 24, 2007
1 parent f4e6663 commit 182100ade46f1c2ff47a69e872d8f8be987fa9dc
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/app/composer/qgscomposervectorlegend.cpp
@@ -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
@@ -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;
@@ -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 );

0 comments on commit 182100a

Please sign in to comment.