Skip to content

Commit

Permalink
Edit symbol transparency in percent values [0-100] instead of [0-1]
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jan 31, 2012
1 parent f854acb commit f490d0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/symbology-ng/qgsrendererv2widget.cpp
Expand Up @@ -61,13 +61,14 @@ void QgsRendererV2Widget::changeSymbolTransparency()
}

bool ok;
double transparency = QInputDialog::getDouble( this, tr( "Transparency" ), tr( "Change symbol transparency" ), 1 - symbolList.at( 0 )->alpha(), 0.0, 1.0, 1, &ok );
double oldTransparency = ( 1 - symbolList.at( 0 )->alpha() ) * 100; // convert to percents
double transparency = QInputDialog::getDouble( this, tr( "Transparency" ), tr( "Change symbol transparency [%]" ), oldTransparency, 0.0, 100.0, 0, &ok );
if ( ok )
{
QList<QgsSymbolV2*>::iterator symbolIt = symbolList.begin();
for ( ; symbolIt != symbolList.end(); ++symbolIt )
{
( *symbolIt )->setAlpha( 1 - transparency );
( *symbolIt )->setAlpha( 1 - transparency / 100 );
}
refreshSymbolView();
}
Expand Down

0 comments on commit f490d0a

Please sign in to comment.