Skip to content

Commit

Permalink
skip labels with size<=0 - otherwise the size is ignored
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@10116 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 6, 2009
1 parent b5d3a15 commit 7a8d9ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/qgslabel.cpp
Expand Up @@ -91,7 +91,6 @@ void QgsLabel::renderLabel( QPainter * painter, const QgsRectangle& viewExtent,
QgsFeature &feature, bool selected, QgsLabelAttributes *classAttributes,
double sizeScale, double rasterScaleFactor )
{

QPen pen;
QFont font;
QString value;
Expand Down Expand Up @@ -163,10 +162,11 @@ void QgsLabel::renderLabel( QPainter * painter, const QgsRectangle& viewExtent,
//and scale the painter down by rasterScaleFactor when drawing the label
size *= rasterScaleFactor;

if ( size > 0.0 )
{
font.setPixelSize( size );
}
if (( int )size <= 0 )
// skip too small labels
return;

font.setPixelSize( size );

value = fieldValue( Color, feature );
if ( value.isEmpty() )
Expand Down

0 comments on commit 7a8d9ea

Please sign in to comment.