r18128 by jghali - #11403 (inaccurate on screen gradient display) : additional fixes

scribus-commit scribus-commit at lists.scribus.net
Wed Feb 6 22:58:50 UTC 2013


Author: jghali
Date: Wed Feb  6 22:58:50 2013
New Revision: 18128

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18128
Log:
#11403 (inaccurate on screen gradient display) : additional fixes 

Modified:
    trunk/Scribus/scribus/plugins/import/ai/importai.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
    trunk/Scribus/scribus/scpainter.cpp

Modified: trunk/Scribus/scribus/plugins/import/ai/importai.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18128&path=/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importai.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importai.cpp Wed Feb  6 22:58:50 2013
@@ -2686,14 +2686,16 @@
 			else if (colortype == 3)
 			{
 				stopName = parseCustomColor(Cdata, colorShade);
+				int stopShade = qRound(colorShade);
 				const ScColor& gradC = m_Doc->PageColors[stopName];
-				currentGradient.addStop( ScColorEngine::getRGBColor(gradC, m_Doc), stop, 0.5, 1.0, stopName, qRound(colorShade));
+				currentGradient.addStop( ScColorEngine::getShadeColor(gradC, m_Doc, stopShade), stop, 0.5, 1.0, stopName, stopShade);
 			}
 			else if (colortype == 4)
 			{
 				stopName = parseCustomColorX(Cdata, colorShade, "0");
+				int stopShade = qRound(colorShade);
 				const ScColor& gradC = m_Doc->PageColors[stopName];
-				currentGradient.addStop( ScColorEngine::getRGBColor(gradC, m_Doc), stop, 0.5, 1.0, stopName, qRound(colorShade));
+				currentGradient.addStop( ScColorEngine::getShadeColor(gradC, m_Doc, stopShade), stop, 0.5, 1.0, stopName, stopShade);
 			}
 			else if (colortype == 6)
 			{

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18128&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp Wed Feb  6 22:58:50 2013
@@ -1041,13 +1041,13 @@
 				{
 					const ScColor& col1 = m_Doc->PageColors[c];
 					const ScColor& col2 = m_Doc->PageColors[c2];
-					oostyle.gradient.addStop( ScColorEngine::getRGBColor(col2, m_Doc), 0.0, 0.5, 1, c2, shadeE );
-					oostyle.gradient.addStop( ScColorEngine::getRGBColor(col1, m_Doc), 1.0 - border, 0.5, 1, c, shadeS );
+					oostyle.gradient.addStop( ScColorEngine::getShadeColor(col2, m_Doc, shadeE), 0.0, 0.5, 1, c2, shadeE );
+					oostyle.gradient.addStop( ScColorEngine::getShadeColor(col1, m_Doc, shadeS), 1.0 - border, 0.5, 1, c, shadeS );
 				}
 				else
 				{
-					oostyle.gradient.addStop( ScColorEngine::getRGBColor(col1, m_Doc), border, 0.5, 1, c, shadeS );
-					oostyle.gradient.addStop( ScColorEngine::getRGBColor(col2, m_Doc), 1.0, 0.5, 1, c2, shadeE );
+					oostyle.gradient.addStop( ScColorEngine::getShadeColor(col1, m_Doc, shadeS), border, 0.5, 1, c, shadeS );
+					oostyle.gradient.addStop( ScColorEngine::getShadeColor(col2, m_Doc, shadeE), 1.0, 0.5, 1, c2, shadeE );
 				}
 			}
 		}

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18128&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Wed Feb  6 22:58:50 2013
@@ -1771,12 +1771,12 @@
 			GfxColor temp;
 			((GfxAxialShading*)shading)->getColor(bounds[i], &temp);
 			QString stopColor = getColor(color_space, &temp, &shade);
-			FillGradient.addStop( ScColorEngine::getRGBColor(m_doc->PageColors[stopColor], m_doc), bounds[i], 0.5, 1.0, stopColor, shade );
+			FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), bounds[i], 0.5, 1.0, stopColor, shade );
 			if (i == num_funcs - 1)
 			{
 				((GfxAxialShading*)shading)->getColor(bounds[i+1], &temp);
 				QString stopColor = getColor(color_space, &temp, &shade);
-				FillGradient.addStop( ScColorEngine::getRGBColor(m_doc->PageColors[stopColor], m_doc), bounds[i+1], 0.5, 1.0, stopColor, shade );
+				FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), bounds[i+1], 0.5, 1.0, stopColor, shade );
 			}
 		}
 	}
@@ -1785,11 +1785,11 @@
 		GfxColor stop1;
 		((GfxAxialShading*)shading)->getColor(0.0, &stop1);
 		QString stopColor1 = getColor(color_space, &stop1, &shade);
-		FillGradient.addStop( ScColorEngine::getRGBColor(m_doc->PageColors[stopColor1], m_doc), 0.0, 0.5, 1.0, stopColor1, shade );
+		FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor1], m_doc, shade), 0.0, 0.5, 1.0, stopColor1, shade );
 		GfxColor stop2;
 		((GfxAxialShading*)shading)->getColor(1.0, &stop2);
 		QString stopColor2 = getColor(color_space, &stop2, &shade);
-		FillGradient.addStop( ScColorEngine::getRGBColor(m_doc->PageColors[stopColor2], m_doc), 1.0, 0.5, 1.0, stopColor2, shade );
+		FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor2], m_doc, shade), 1.0, 0.5, 1.0, stopColor2, shade );
 	}
 	((GfxAxialShading*)shading)->getCoords(&GrStartX, &GrStartY, &GrEndX, &GrEndY);
 	double xmin, ymin, xmax, ymax;
@@ -1866,12 +1866,12 @@
 			GfxColor temp;
 			((GfxRadialShading*)shading)->getColor(bounds[i], &temp);
 			QString stopColor = getColor(color_space, &temp, &shade);
-			FillGradient.addStop( ScColorEngine::getRGBColor(m_doc->PageColors[stopColor], m_doc), bounds[i], 0.5, 1.0, stopColor, shade );
+			FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), bounds[i], 0.5, 1.0, stopColor, shade );
 			if (i == num_funcs - 1)
 			{
 				((GfxRadialShading*)shading)->getColor(bounds[i+1], &temp);
 				QString stopColor = getColor(color_space, &temp, &shade);
-				FillGradient.addStop( ScColorEngine::getRGBColor(m_doc->PageColors[stopColor], m_doc), bounds[i+1], 0.5, 1.0, stopColor, shade );
+				FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), bounds[i+1], 0.5, 1.0, stopColor, shade );
 			}
 		}
 	}
@@ -1880,11 +1880,11 @@
 		GfxColor stop1;
 		((GfxRadialShading*)shading)->getColor(0.0, &stop1);
 		QString stopColor1 = getColor(color_space, &stop1, &shade);
-		FillGradient.addStop( ScColorEngine::getRGBColor(m_doc->PageColors[stopColor1], m_doc), 0.0, 0.5, 1.0, stopColor1, shade );
+		FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor1], m_doc, shade), 0.0, 0.5, 1.0, stopColor1, shade );
 		GfxColor stop2;
 		((GfxRadialShading*)shading)->getColor(1.0, &stop2);
 		QString stopColor2 = getColor(color_space, &stop2, &shade);
-		FillGradient.addStop( ScColorEngine::getRGBColor(m_doc->PageColors[stopColor2], m_doc), 1.0, 0.5, 1.0, stopColor2, shade );
+		FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor2], m_doc, shade), 1.0, 0.5, 1.0, stopColor2, shade );
 	}
 	double r0, x1, y1, r1;
 	((GfxRadialShading*)shading)->getCoords(&GrStartX, &GrStartY, &r0, &x1, &y1, &r1);

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18128&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Wed Feb  6 22:58:50 2013
@@ -827,12 +827,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);
 			double a = colorStops[offset]->opacity;
 			double r, g, b;
 			qStopColor.getRgbF(&r, &g, &b);




More information about the scribus-commit mailing list