r18126 by fschmid - Fixed Bug #11413: "Inacurate on screen gradient display", color shade was accidently applied twice for the display

scribus-commit scribus-commit at lists.scribus.net
Wed Feb 6 20:24:36 UTC 2013


Author: fschmid
Date: Wed Feb  6 20:24:36 2013
New Revision: 18126

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18126
Log:
Fixed Bug #11413: "Inacurate on screen gradient display", color shade was accidently applied twice for the display

Modified:
    trunk/Scribus/scribus/scpainter.cpp

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18126&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Wed Feb  6 20:24:36 2013
@@ -1081,12 +1081,6 @@
 			for( int offset = 0 ; offset < colorStops.count() ; offset++ )
 			{
 				qStopColor = colorStops[ offset ]->color;
-				int h, s, v, sneu, vneu;
-				int shad = colorStops[offset]->shade;
-				qStopColor.getHsv(&h, &s, &v);
-				sneu = s * shad / 100;
-				vneu = 255 - ((255 - v) * shad / 100);
-				qStopColor.setHsv(h, sneu, vneu);
 				qStopColor.setAlphaF(colorStops[offset]->opacity);
 				qStopColors.append(qStopColor);
 			}
@@ -1627,23 +1621,15 @@
 			cairo_pattern_set_extend(pat, CAIRO_EXTEND_PAD);
 			cairo_pattern_set_filter(pat, CAIRO_FILTER_GOOD);
 			QList<VColorStop*> colorStops = fill_gradient.colorStops();
-			QColor qStopColor;
 			for( int offset = 0 ; offset < colorStops.count() ; offset++ )
 			{
-				qStopColor = colorStops[ offset ]->color;
 				rampPoint  = colorStops[ offset ]->rampPoint;
 				if ((lastPoint == rampPoint) && (!isFirst))
 					continue;
 				isFirst = false;
-				int h, s, v, sneu, vneu;
-				int shad = colorStops[offset]->shade;
-				qStopColor.getHsv(&h, &s, &v);
-				sneu = s * shad / 100;
-				vneu = 255 - ((255 - v) * shad / 100);
-				qStopColor.setHsv(h, sneu, vneu);
 				double a = colorStops[offset]->opacity;
 				double r, g, b;
-				qStopColor.getRgbF(&r, &g, &b);
+				colorStops[ offset ]->color.getRgbF(&r, &g, &b);
 				cairo_pattern_add_color_stop_rgba (pat, colorStops[ offset ]->rampPoint, r, g, b, a);
 				lastPoint = rampPoint;
 			}
@@ -1833,23 +1819,15 @@
 		cairo_pattern_set_extend(pat, CAIRO_EXTEND_PAD);
 		cairo_pattern_set_filter(pat, CAIRO_FILTER_GOOD);
 		QList<VColorStop*> colorStops = stroke_gradient.colorStops();
-		QColor qStopColor;
 		for( int offset = 0 ; offset < colorStops.count() ; offset++ )
 		{
-			qStopColor = colorStops[ offset ]->color;
 			rampPoint  = colorStops[ offset ]->rampPoint;
 			if ((lastPoint == rampPoint) && (!isFirst))
 				continue;
 			isFirst = false;
-			int h, s, v, sneu, vneu;
-			int shad = colorStops[offset]->shade;
-			qStopColor.getHsv(&h, &s, &v);
-			sneu = s * shad / 100;
-			vneu = 255 - ((255 - v) * shad / 100);
-			qStopColor.setHsv(h, sneu, vneu);
 			double a = colorStops[offset]->opacity;
 			double r, g, b;
-			qStopColor.getRgbF(&r, &g, &b);
+			colorStops[ offset ]->color.getRgbF(&r, &g, &b);
 			cairo_pattern_add_color_stop_rgba (pat, rampPoint, r, g, b, a);
 			lastPoint = rampPoint;
 		}




More information about the scribus-commit mailing list