Skip to content

Commit

Permalink
Fix scale-dependent, data defined fields test against renderer's scal…
Browse files Browse the repository at this point in the history
…e for accuracy
  • Loading branch information
dakcarto committed Aug 16, 2012
1 parent 7079f20 commit b2f3214
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/qgspallabeling.cpp
Expand Up @@ -522,9 +522,8 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f
if ( minScaleValue.isValid() )
{
bool conversionOk;
int minScale = minScaleValue.toInt( &conversionOk );
// TODO: occasional floating point issues?
if ( conversionOk && ( int )( context.rendererScale() ) < minScale )
double minScale = minScaleValue.toDouble( &conversionOk );
if ( conversionOk && context.rendererScale() < minScale )
{
return;
}
Expand All @@ -539,9 +538,8 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f
if ( maxScaleValue.isValid() )
{
bool conversionOk;
int maxScale = maxScaleValue.toInt( &conversionOk );
// TODO: occasional floating point issues?
if ( conversionOk && ( int )( context.rendererScale() ) > maxScale )
double maxScale = maxScaleValue.toDouble( &conversionOk );
if ( conversionOk && context.rendererScale() > maxScale )
{
return;
}
Expand Down

0 comments on commit b2f3214

Please sign in to comment.