From e3aefe524a91c01dee8607ff471f2d6d16db5992 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Thu, 25 Mar 2010 01:02:05 +0000 Subject: [PATCH] fixed gradient ranges to avoid warning from Qt at runtime svn path=/trunk/KDE/kdebase/workspace/; revision=1107187 --- clients/oxygen/oxygenshadowcache.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/clients/oxygen/oxygenshadowcache.cpp b/clients/oxygen/oxygenshadowcache.cpp index 0be8368703..17dd77a3c0 100644 --- a/clients/oxygen/oxygenshadowcache.cpp +++ b/clients/oxygen/oxygenshadowcache.cpp @@ -345,10 +345,13 @@ namespace Oxygen { QColor c( stops[i].second ); qreal xx( stops[i].first -4.0/rg.radius() ); - if( xx<0 && i < stops.size()-1 ) + if( xx<0 ) { - qreal x1( stops[i+1].first -4.0/rg.radius() ); - c = KColorUtils::mix( c, stops[i+1].second, -xx/(x1-xx) ); + if( i < stops.size()-1 ) + { + qreal x1( stops[i+1].first -4.0/rg.radius() ); + c = KColorUtils::mix( c, stops[i+1].second, -xx/(x1-xx) ); + } xx = 0; } @@ -368,10 +371,13 @@ namespace Oxygen { QColor c( stops[i].second ); qreal xx( stops[i].first -4.0/rg.radius() ); - if( xx<0 && i < stops.size()-1 ) + if( xx<0 ) { - qreal x1( stops[i+1].first -4.0/rg.radius() ); - c = KColorUtils::mix( c, stops[i+1].second, -xx/(x1-xx) ); + if( i < stops.size()-1 ) + { + qreal x1( stops[i+1].first -4.0/rg.radius() ); + c = KColorUtils::mix( c, stops[i+1].second, -xx/(x1-xx) ); + } xx = 0; }