Skip to content

Commit 0634377

Browse files
committedJun 27, 2016
Fix context menu options for graduated ranges does nothing
1 parent 5078e46 commit 0634377

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,10 +1082,14 @@ QList<QgsSymbolV2*> QgsGraduatedSymbolRendererV2Widget::selectedSymbols()
10821082

10831083
QgsSymbolV2* QgsGraduatedSymbolRendererV2Widget::findSymbolForRange( double lowerBound, double upperBound, const QgsRangeList& ranges ) const
10841084
{
1085+
int decimalPlaces = mRenderer->labelFormat().precision() + 2;
1086+
if ( decimalPlaces < 0 )
1087+
decimalPlaces = 0;
1088+
double precision = 1.0 / qPow( 10, decimalPlaces );
1089+
10851090
for ( QgsRangeList::const_iterator it = ranges.begin(); it != ranges.end(); ++it )
10861091
{
1087-
//range string has been created with option 'f',4
1088-
if ( qgsDoubleNear( lowerBound, it->lowerValue(), 0.0001 ) && qgsDoubleNear( upperBound, it->upperValue(), 0.0001 ) )
1092+
if ( qgsDoubleNear( lowerBound, it->lowerValue(), precision ) && qgsDoubleNear( upperBound, it->upperValue(), precision ) )
10891093
{
10901094
return it->symbol();
10911095
}

0 commit comments

Comments
 (0)
Please sign in to comment.