Skip to content

Commit f490d0a

Browse files
committedJan 31, 2012
Edit symbol transparency in percent values [0-100] instead of [0-1]
1 parent f854acb commit f490d0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ void QgsRendererV2Widget::changeSymbolTransparency()
6161
}
6262

6363
bool ok;
64-
double transparency = QInputDialog::getDouble( this, tr( "Transparency" ), tr( "Change symbol transparency" ), 1 - symbolList.at( 0 )->alpha(), 0.0, 1.0, 1, &ok );
64+
double oldTransparency = ( 1 - symbolList.at( 0 )->alpha() ) * 100; // convert to percents
65+
double transparency = QInputDialog::getDouble( this, tr( "Transparency" ), tr( "Change symbol transparency [%]" ), oldTransparency, 0.0, 100.0, 0, &ok );
6566
if ( ok )
6667
{
6768
QList<QgsSymbolV2*>::iterator symbolIt = symbolList.begin();
6869
for ( ; symbolIt != symbolList.end(); ++symbolIt )
6970
{
70-
( *symbolIt )->setAlpha( 1 - transparency );
71+
( *symbolIt )->setAlpha( 1 - transparency / 100 );
7172
}
7273
refreshSymbolView();
7374
}

0 commit comments

Comments
 (0)
Please sign in to comment.