r21290 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Fri May 6 09:26:31 UTC 2016
Author: jghali
Date: Fri May 6 09:26:31 2016
New Revision: 21290
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21290
Log:
r21289 follow-up: fix also Windows printing
Modified:
trunk/Scribus/scribus/scpainterex_cairo.cpp
Modified: trunk/Scribus/scribus/scpainterex_cairo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21290&path=/trunk/Scribus/scribus/scpainterex_cairo.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainterex_cairo.cpp (original)
+++ trunk/Scribus/scribus/scpainterex_cairo.cpp Fri May 6 09:26:31 2016
@@ -855,6 +855,7 @@
double r, g, b, a;
QList<VColorStopEx*> colorStops = gradient.colorStops();
QList<QColor> qStopColors;
+ QList<double> qStopRampPoints;
QColor qStopColor;
for( int offset = 0 ; offset < colorStops.count() ; offset++ )
{
@@ -867,7 +868,16 @@
vneu = 255 - ((255 - v) * shad / 100);
qStopColor.setHsv(h, sneu, vneu);
qStopColor.setAlphaF(colorStops[offset]->opacity);
+ if (offset == 0)
+ {
+ if (colorStops[offset]->rampPoint > 0)
+ {
+ qStopColors.append(qStopColor);
+ qStopRampPoints.append(0);
+ }
+ }
qStopColors.append(qStopColor);
+ qStopRampPoints.append(colorStops[offset]->rampPoint);
}
qStopColors.last().getRgbF(&r, &g, &b, &a);
QPointF centerP = QPointF(m_gradControlP5.x(), m_gradControlP5.y());
@@ -892,7 +902,7 @@
cairo_fill(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_ADD);
mpat = cairo_pattern_create_mesh();
- for( int offset = 1 ; offset < colorStops.count() ; offset++ )
+ for( int offset = 1 ; offset < qStopRampPoints.count() ; offset++ )
{
QLineF e1 = edge1;
QLineF e1s = edge1;
@@ -902,14 +912,14 @@
QLineF e3s = edge3;
QLineF e4 = edge4;
QLineF e4s = edge4;
- e1.setLength(edge1.length() * colorStops[ offset ]->rampPoint);
- e2.setLength(edge2.length() * colorStops[ offset ]->rampPoint);
- e3.setLength(edge3.length() * colorStops[ offset ]->rampPoint);
- e4.setLength(edge4.length() * colorStops[ offset ]->rampPoint);
- e1s.setLength(edge1.length() * colorStops[ offset - 1 ]->rampPoint);
- e2s.setLength(edge2.length() * colorStops[ offset - 1 ]->rampPoint);
- e3s.setLength(edge3.length() * colorStops[ offset - 1 ]->rampPoint);
- e4s.setLength(edge4.length() * colorStops[ offset - 1 ]->rampPoint);
+ e1.setLength(edge1.length() * qStopRampPoints[ offset ]);
+ e2.setLength(edge2.length() * qStopRampPoints[ offset ]);
+ e3.setLength(edge3.length() * qStopRampPoints[ offset ]);
+ e4.setLength(edge4.length() * qStopRampPoints[ offset ]);
+ e1s.setLength(edge1.length() * qStopRampPoints[ offset - 1 ]);
+ e2s.setLength(edge2.length() * qStopRampPoints[ offset - 1 ]);
+ e3s.setLength(edge3.length() * qStopRampPoints[ offset - 1 ]);
+ e4s.setLength(edge4.length() * qStopRampPoints[ offset - 1 ]);
if (offset == 1)
{
cairo_mesh_pattern_begin_patch(mpat);
More information about the scribus-commit
mailing list