Skip to content

Commit 85bbe40

Browse files
author
jef
committed
skip labels with size<=0 - otherwise the size is ignored
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10116 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 10b05ab commit 85bbe40

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core/qgslabel.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ void QgsLabel::renderLabel( QPainter * painter, const QgsRectangle& viewExtent,
9191
QgsFeature &feature, bool selected, QgsLabelAttributes *classAttributes,
9292
double sizeScale, double rasterScaleFactor )
9393
{
94-
9594
QPen pen;
9695
QFont font;
9796
QString value;
@@ -163,10 +162,11 @@ void QgsLabel::renderLabel( QPainter * painter, const QgsRectangle& viewExtent,
163162
//and scale the painter down by rasterScaleFactor when drawing the label
164163
size *= rasterScaleFactor;
165164

166-
if ( size > 0.0 )
167-
{
168-
font.setPixelSize( size );
169-
}
165+
if (( int )size <= 0 )
166+
// skip too small labels
167+
return;
168+
169+
font.setPixelSize( size );
170170

171171
value = fieldValue( Color, feature );
172172
if ( value.isEmpty() )

0 commit comments

Comments
 (0)