Navigation Menu

Skip to content

Commit

Permalink
Fix context menu options for graduated ranges does nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 27, 2016
1 parent 5078e46 commit 0634377
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
Expand Up @@ -1082,10 +1082,14 @@ QList<QgsSymbolV2*> QgsGraduatedSymbolRendererV2Widget::selectedSymbols()

QgsSymbolV2* QgsGraduatedSymbolRendererV2Widget::findSymbolForRange( double lowerBound, double upperBound, const QgsRangeList& ranges ) const
{
int decimalPlaces = mRenderer->labelFormat().precision() + 2;
if ( decimalPlaces < 0 )
decimalPlaces = 0;
double precision = 1.0 / qPow( 10, decimalPlaces );

for ( QgsRangeList::const_iterator it = ranges.begin(); it != ranges.end(); ++it )
{
//range string has been created with option 'f',4
if ( qgsDoubleNear( lowerBound, it->lowerValue(), 0.0001 ) && qgsDoubleNear( upperBound, it->upperValue(), 0.0001 ) )
if ( qgsDoubleNear( lowerBound, it->lowerValue(), precision ) && qgsDoubleNear( upperBound, it->upperValue(), precision ) )
{
return it->symbol();
}
Expand Down

0 comments on commit 0634377

Please sign in to comment.