r19163 by fschmid - Fix gradient extend property for named gradients.
scribus-commit
scribus-commit at lists.scribus.net
Sat May 31 08:00:14 UTC 2014
Author: fschmid
Date: Sat May 31 08:00:14 2014
New Revision: 19163
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19163
Log:
Fix gradient extend property for named gradients.
Modified:
trunk/Scribus/scribus/pageitem.cpp
trunk/Scribus/scribus/pageitem.h
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
trunk/Scribus/scribus/pslib.cpp
Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19163&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Sat May 31 08:00:14 2014
@@ -1712,6 +1712,7 @@
if ((patternVal.isEmpty()) || (!m_Doc->docPatterns.contains(patternVal)))
{
p->fill_gradient = VGradient(VGradient::linear);
+ p->fill_gradient.setRepeatMethod(GrExtend);
if (fillColor() != CommonStrings::None)
{
p->setBrush(fillQColor);
@@ -1776,6 +1777,7 @@
{
p->setFillMode(ScPainter::Gradient);
p->fill_gradient = fill_gradient;
+ p->fill_gradient.setRepeatMethod(GrExtend);
switch (GrType)
{
case 1:
@@ -1971,6 +1973,7 @@
{
p->setStrokeMode(ScPainter::Gradient);
p->stroke_gradient = stroke_gradient;
+ p->stroke_gradient.setRepeatMethod(GrStrokeExtend);
if (GrTypeStroke == 6)
p->setGradient(VGradient::linear, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeStartX, GrStrokeStartY), GrStrokeScale, GrStrokeSkew);
else
@@ -8124,22 +8127,22 @@
void PageItem::setGradientExtend(VGradient::VGradientRepeatMethod val)
{
- fill_gradient.setRepeatMethod(val);
+ GrExtend = val;
}
void PageItem::setStrokeGradientExtend(VGradient::VGradientRepeatMethod val)
{
- stroke_gradient.setRepeatMethod(val);
+ GrStrokeExtend = val;
}
VGradient::VGradientRepeatMethod PageItem::getGradientExtend()
{
- return fill_gradient.repeatMethod();
+ return GrExtend;
}
VGradient::VGradientRepeatMethod PageItem::getStrokeGradientExtend()
{
- return stroke_gradient.repeatMethod();
+ return GrStrokeExtend;
}
Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19163&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Sat May 31 08:00:14 2014
@@ -1203,6 +1203,7 @@
double GrFocalY;
double GrScale;
double GrSkew;
+ VGradient::VGradientRepeatMethod GrExtend;
FPoint GrControl1;
FPoint GrControl2;
FPoint GrControl3;
@@ -1400,6 +1401,7 @@
double GrStrokeFocalY;
double GrStrokeScale;
double GrStrokeSkew;
+ VGradient::VGradientRepeatMethod GrStrokeExtend;
/**
* @brief Mask gradient variables
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19163&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sat May 31 08:00:14 2014
@@ -8158,6 +8158,7 @@
gradient = doc.docGradients[currItem->strokeGradient()];
else
gradient = currItem->stroke_gradient;
+ gradient.setRepeatMethod(currItem->getStrokeGradientExtend());
}
else
{
@@ -8182,6 +8183,7 @@
gradient = doc.docGradients[currItem->gradient()];
else
gradient = currItem->fill_gradient;
+ gradient.setRepeatMethod(currItem->getGradientExtend());
}
QList<VColorStop*> cstops = gradient.colorStops();
StopVec.clear();
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19163&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sat May 31 08:00:14 2014
@@ -5474,8 +5474,8 @@
currItem->inlineCharID = attrs.valueAsInt("InID", -1);
else
currItem->inlineCharID = -1;
- currItem->fill_gradient.setRepeatMethod((VGradient::VGradientRepeatMethod)(attrs.valueAsInt("GRExt", VGradient::pad)));
- currItem->stroke_gradient.setRepeatMethod((VGradient::VGradientRepeatMethod)(attrs.valueAsInt("GRExtS", VGradient::pad)));
+ currItem->setGradientExtend((VGradient::VGradientRepeatMethod)(attrs.valueAsInt("GRExt", VGradient::pad)));
+ currItem->setStrokeGradientExtend((VGradient::VGradientRepeatMethod)(attrs.valueAsInt("GRExtS", VGradient::pad)));
currItem->mask_gradient.setRepeatMethod((VGradient::VGradientRepeatMethod)(attrs.valueAsInt("GRExtM", VGradient::pad)));
currItem->setHasSoftShadow(attrs.valueAsBool("HASSOFTSHADOW", false));
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19163&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sat May 31 08:00:14 2014
@@ -1813,7 +1813,7 @@
docu.writeAttribute("GRFOCALY", item->GrFocalY);
docu.writeAttribute("GRSCALE" , item->GrScale);
docu.writeAttribute("GRSKEW" , item->GrSkew);
- docu.writeAttribute("GRExt", item->fill_gradient.repeatMethod());
+ docu.writeAttribute("GRExt", item->getGradientExtend());
if ((item->GrType == 9) || (item->GrType == 10))
{
docu.writeAttribute("GRC1X" , item->GrControl1.x());
@@ -1850,7 +1850,7 @@
docu.writeAttribute("GRNAMEM", item->gradientMask());
if (item->GrTypeStroke > 0)
{
- docu.writeAttribute("GRExtS", item->stroke_gradient.repeatMethod());
+ docu.writeAttribute("GRExtS", item->getStrokeGradientExtend());
docu.writeAttribute("GRSTARTXS", item->GrStrokeStartX);
docu.writeAttribute("GRSTARTYS", item->GrStrokeStartY);
docu.writeAttribute("GRENDXS", item->GrStrokeEndX);
Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19163&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp Sat May 31 08:00:14 2014
@@ -700,6 +700,7 @@
{
item->fill_gradient = gc->FillGradient;
item->setGradient(importedGradTrans[gc->GFillCol1]);
+ item->setGradientExtend(VGradient::pad);
if (!gc->FillCSpace)
{
item->GrStartX = gc->GradFillX1 * item->width();
@@ -773,6 +774,7 @@
{
item->stroke_gradient = gc->StrokeGradient;
item->setStrokeGradient(importedGradTrans[gc->GStrokeCol1]);
+ item->setStrokeGradientExtend(VGradient::pad);
if (!gc->StrokeCSpace)
{
item->GrStrokeStartX = gc->GradStrokeX1 * item->width();
Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19163&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Sat May 31 08:00:14 2014
@@ -4176,6 +4176,7 @@
gradient = m_Doc->docGradients[c->gradient()];
else
gradient = c->fill_gradient;
+ gradient.setRepeatMethod(c->getGradientExtend());
QList<VColorStop*> colorStops = gradient.colorStops();
for (uint cst = 0; cst < gradient.Stops(); ++cst)
{
@@ -4512,6 +4513,7 @@
gradient = m_Doc->docGradients[c->strokeGradient()];
else
gradient = c->stroke_gradient;
+ gradient.setRepeatMethod(c->getStrokeGradientExtend());
}
else
{
@@ -4528,6 +4530,7 @@
gradient = m_Doc->docGradients[c->gradient()];
else
gradient = c->fill_gradient;
+ gradient.setRepeatMethod(c->getGradientExtend());
if (GType == 8)
{
QTransform patternMatrix;
More information about the scribus-commit
mailing list