fixed gradient ranges to avoid warning from Qt at runtime

svn path=/trunk/KDE/kdebase/workspace/; revision=1107187
This commit is contained in:
Hugo Pereira Da Costa 2010-03-25 01:02:05 +00:00
parent 49411bcda5
commit e3aefe524a

View file

@ -345,10 +345,13 @@ namespace Oxygen
{ {
QColor c( stops[i].second ); QColor c( stops[i].second );
qreal xx( stops[i].first -4.0/rg.radius() ); qreal xx( stops[i].first -4.0/rg.radius() );
if( xx<0 && i < stops.size()-1 ) if( xx<0 )
{
if( i < stops.size()-1 )
{ {
qreal x1( stops[i+1].first -4.0/rg.radius() ); qreal x1( stops[i+1].first -4.0/rg.radius() );
c = KColorUtils::mix( c, stops[i+1].second, -xx/(x1-xx) ); c = KColorUtils::mix( c, stops[i+1].second, -xx/(x1-xx) );
}
xx = 0; xx = 0;
} }
@ -368,10 +371,13 @@ namespace Oxygen
{ {
QColor c( stops[i].second ); QColor c( stops[i].second );
qreal xx( stops[i].first -4.0/rg.radius() ); qreal xx( stops[i].first -4.0/rg.radius() );
if( xx<0 && i < stops.size()-1 ) if( xx<0 )
{
if( i < stops.size()-1 )
{ {
qreal x1( stops[i+1].first -4.0/rg.radius() ); qreal x1( stops[i+1].first -4.0/rg.radius() );
c = KColorUtils::mix( c, stops[i+1].second, -xx/(x1-xx) ); c = KColorUtils::mix( c, stops[i+1].second, -xx/(x1-xx) );
}
xx = 0; xx = 0;
} }