r14260 by fschmid - Allow shearing for fill and stroke patterns.
scribus-commit
scribus-commit at lists.scribus.net
Wed Nov 4 14:22:04 CET 2009
Revision: 14260
Author: fschmid
Date: 2009-11-04T08:08:05.699580Z
Commit message: Allow shearing for fill and stroke patterns.
Changeset:
M /trunk/Scribus/scribus/scpainter.cpp
M /trunk/Scribus/scribus/ui/propertiespalette.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
M /trunk/Scribus/scribus/pageitem.cpp
M /trunk/Scribus/scribus/scribusXml.cpp
M /trunk/Scribus/scribus/plugins/pctimplugin/importpct.cpp
M /trunk/Scribus/scribus/scpainter.h
M /trunk/Scribus/scribus/scribusdoc.cpp
M /trunk/Scribus/scribus/pageitem.h
M /trunk/Scribus/scribus/pageitem_line.cpp
M /trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
M /trunk/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
M /trunk/Scribus/scribus/plugins/aiimplugin/importai.cpp
M /trunk/Scribus/scribus/scribusview.cpp
M /trunk/Scribus/scribus/scribusdoc.h
M /trunk/Scribus/scribus/pageitem_polyline.cpp
M /trunk/Scribus/scribus/scribusstructs.h
M /trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
M /trunk/Scribus/scribus/pdflib_core.cpp
M /trunk/Scribus/scribus/pslib.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M /trunk/Scribus/scribus/pageitem_textframe.cpp
M /trunk/Scribus/scribus/pageitem_pathtext.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M /trunk/Scribus/scribus/ui/cpalette.cpp
M /trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
M /trunk/Scribus/scribus/scpageoutput.cpp
M /trunk/Scribus/scribus/ui/cpalette.h
M /trunk/Scribus/scribus/pageitem_desaxe.cpp
M /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
M /trunk/Scribus/scribus/canvasmode_copyproperties.cpp
Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp (revision 14259)
+++ scribus/pdflib_core.cpp (revision 14260)
@@ -5678,14 +5678,15 @@
mpa.translate(currItem->xPos() - ActPageP->xOffset(), ActPageP->height() - (currItem->yPos() - ActPageP->yOffset()));
mpa.rotate(-currItem->rotation());
}
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
if (stroke)
- currItem->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ currItem->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
else
- currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
mpa.translate(-currItem->lineWidth() / 2.0, currItem->lineWidth() / 2.0);
mpa.translate(patternOffsetX, -patternOffsetY);
mpa.rotate(-patternRotation);
+ mpa.shear(patternSkewX, -patternSkewY);
mpa.scale(pat->scaleX, pat->scaleY);
mpa.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
PutDoc("/Matrix ["+FToStr(mpa.m11())+" "+FToStr(mpa.m12())+" "+FToStr(mpa.m21())+" "+FToStr(mpa.m22())+" "+FToStr(mpa.dx())+" "+FToStr(mpa.dy())+"]\n");
@@ -6272,10 +6273,11 @@
mpa.translate(currItem->xPos() - ActPageP->xOffset(), ActPageP->height() - (currItem->yPos() - ActPageP->yOffset()));
mpa.rotate(-currItem->rotation());
}
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
mpa.translate(patternOffsetX, -patternOffsetY);
mpa.rotate(-patternRotation);
+ mpa.shear(patternSkewX, -patternSkewY);
mpa.scale(pat->scaleX, pat->scaleY);
mpa.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
PutDoc("/Matrix ["+FToStr(mpa.m11())+" "+FToStr(mpa.m12())+" "+FToStr(mpa.m21())+" "+FToStr(mpa.m22())+" "+FToStr(mpa.dx())+" "+FToStr(mpa.dy())+"]\n");
Index: scribus/pageitem_line.cpp
===================================================================
--- scribus/pageitem_line.cpp (revision 14259)
+++ scribus/pageitem_line.cpp (revision 14260)
@@ -60,7 +60,7 @@
{
if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)))
{
- p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation);
+ p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation, patternStrokeSkewX, patternStrokeSkewY);
p->setStrokeMode(ScPainter::Pattern);
}
else if (GrTypeStroke > 0)
Index: scribus/canvasmode_copyproperties.cpp
===================================================================
--- scribus/canvasmode_copyproperties.cpp (revision 14259)
+++ scribus/canvasmode_copyproperties.cpp (revision 14260)
@@ -155,7 +155,7 @@
SeleItem(m);
if (GetItem(&currItem))
{
- double sx, sy, ex, ey, r;
+ double sx, sy, ex, ey, r, skx, sky;
currItem->ColGap = m_doc->ElemToLink->ColGap;
currItem->Cols = m_doc->ElemToLink->Cols;
currItem->BottomLine = m_doc->ElemToLink->BottomLine;
@@ -185,11 +185,11 @@
currItem->setGradientVector(sx, sy, ex, ey);
// Pattern Properties
currItem->setPattern(m_doc->ElemToLink->pattern());
- m_doc->ElemToLink->patternTransform(sx, sy, ex, ey, r);
- currItem->setPatternTransform(sx, sy, ex, ey, r);
+ m_doc->ElemToLink->patternTransform(sx, sy, ex, ey, r, skx, sky);
+ currItem->setPatternTransform(sx, sy, ex, ey, r, skx, sky);
currItem->setStrokePattern(m_doc->ElemToLink->strokePattern());
- m_doc->ElemToLink->strokePatternTransform(sx, sy, ex, ey, r);
- currItem->setStrokePatternTransform(sx, sy, ex, ey, r);
+ m_doc->ElemToLink->strokePatternTransform(sx, sy, ex, ey, r, skx, sky);
+ currItem->setStrokePatternTransform(sx, sy, ex, ey, r, skx, sky);
// Set Gradient type after all properties
currItem->setGradientType(m_doc->ElemToLink->gradientType());
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp (revision 14259)
+++ scribus/scribusdoc.cpp (revision 14260)
@@ -5789,7 +5789,7 @@
}
}
-void ScribusDoc::itemSelection_SetItemPatternProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation)
+void ScribusDoc::itemSelection_SetItemPatternProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY)
{
uint selectedItemCount=m_Selection->count();
if (selectedItemCount != 0)
@@ -5799,7 +5799,7 @@
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = m_Selection->itemAt(a);
- currItem->setPatternTransform(imageScaleX, imageScaleY, offsetX, offsetY, rotation);
+ currItem->setPatternTransform(imageScaleX, imageScaleY, offsetX, offsetY, rotation, skewX, skewY);
currItem->update();
}
m_updateManager.setUpdatesEnabled();
@@ -5825,7 +5825,7 @@
}
}
-void ScribusDoc::itemSelection_SetItemStrokePatternProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation)
+void ScribusDoc::itemSelection_SetItemStrokePatternProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY)
{
uint selectedItemCount=m_Selection->count();
if (selectedItemCount != 0)
@@ -5835,7 +5835,7 @@
for (uint a = 0; a < selectedItemCount; ++a)
{
currItem = m_Selection->itemAt(a);
- currItem->setStrokePatternTransform(imageScaleX, imageScaleY, offsetX, offsetY, rotation);
+ currItem->setStrokePatternTransform(imageScaleX, imageScaleY, offsetX, offsetY, rotation, skewX, skewY);
currItem->update();
}
m_updateManager.setUpdatesEnabled();
Index: scribus/pageitem_polyline.cpp
===================================================================
--- scribus/pageitem_polyline.cpp (revision 14259)
+++ scribus/pageitem_polyline.cpp (revision 14260)
@@ -99,7 +99,7 @@
{
if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)))
{
- p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation);
+ p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation, patternStrokeSkewX, patternStrokeSkewY);
p->setStrokeMode(ScPainter::Pattern);
}
else if (GrTypeStroke > 0)
Index: scribus/scribusXml.cpp
===================================================================
--- scribus/scribusXml.cpp (revision 14259)
+++ scribus/scribusXml.cpp (revision 14260)
@@ -177,6 +177,8 @@
OB->patternOffsetX = attrAsDbl(attrs, "pOffsetX", 0.0);
OB->patternOffsetY = attrAsDbl(attrs, "pOffsetY", 0.0);
OB->patternRotation = attrAsDbl(attrs, "pRotation", 0.0);
+ OB->patternSkewX = attrAsDbl(attrs, "pSkewX", 0.0);
+ OB->patternSkewY = attrAsDbl(attrs, "pSkewY", 0.0);
}
else
{
@@ -1223,6 +1225,8 @@
double patternOffsetXS;
double patternOffsetYS;
double patternRotationS;
+ double patternSkewXS;
+ double patternSkewYS;
QString gradNameS;
while(!sReader.atEnd() && !sReader.hasError())
{
@@ -1308,6 +1312,8 @@
patternOffsetXS = attrAsDbl(attrs, "pOffsetXS", 0.0);
patternOffsetYS = attrAsDbl(attrs, "pOffsetYS", 0.0);
patternRotationS = attrAsDbl(attrs, "pRotationS", 0.0);
+ patternSkewXS = attrAsDbl(attrs, "pSkewXS", 0.0);
+ patternSkewYS = attrAsDbl(attrs, "pSkewYS", 0.0);
}
if (inItem && sReader.isStartElement() && tagName == "ITEXT")
{
@@ -1471,7 +1477,7 @@
Neu->setStrokeGradient(gradNameS);
Neu->doOverprint = doOverprint;
Neu->setStrokePattern(StrokePattern);
- Neu->setStrokePatternTransform(patternScaleXS, patternScaleYS, patternOffsetXS, patternOffsetYS, patternRotationS);
+ Neu->setStrokePatternTransform(patternScaleXS, patternScaleYS, patternOffsetXS, patternOffsetYS, patternRotationS, patternSkewXS, patternSkewYS);
storyText.setDefaultStyle(Neu->itemText.defaultStyle());
if (Neu->asLatexFrame())
{
@@ -1646,6 +1652,8 @@
double patternOffsetXS;
double patternOffsetYS;
double patternRotationS;
+ double patternSkewXS;
+ double patternSkewYS;
QString gradNameS;
int lowResType = 1;
int actualPageNumber = 0;
@@ -1675,6 +1683,8 @@
patternOffsetXS = attrAsDbl(attrs, "pOffsetXS", 0.0);
patternOffsetYS = attrAsDbl(attrs, "pOffsetYS", 0.0);
patternRotationS = attrAsDbl(attrs, "pRotationS", 0.0);
+ patternSkewXS = attrAsDbl(attrs, "pSkewXS", 0.0);
+ patternSkewYS = attrAsDbl(attrs, "pSkewYS", 0.0);
inlineF = attrAsBool(attrs1, "isInlineImage", false);
inlineImageData.resize(0);
QString dat = attrAsString(attrs1, "ImageData", "");
@@ -1818,7 +1828,7 @@
Neu->setGradient(gradName);
Neu->setStrokeGradient(gradNameS);
Neu->setStrokePattern(StrokePattern);
- Neu->setStrokePatternTransform(patternScaleXS, patternScaleYS, patternOffsetXS, patternOffsetYS, patternRotationS);
+ Neu->setStrokePatternTransform(patternScaleXS, patternScaleYS, patternOffsetXS, patternOffsetYS, patternRotationS, patternSkewXS, patternSkewYS);
Neu->setXYPos(Neu->xPos() - doc->currentPage()->xOffset(), Neu->yPos() - doc->currentPage()->yOffset(), true);
storyText.setDefaultStyle(Neu->itemText.defaultStyle());
Neu->itemText = storyText;
@@ -2391,13 +2401,15 @@
if (item->GrType == 8)
{
writer.writeAttribute("pattern", item->pattern());
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
writer.writeAttribute("pScaleX" , patternScaleX);
writer.writeAttribute("pScaleY" , patternScaleY);
writer.writeAttribute("pOffsetX" , patternOffsetX);
writer.writeAttribute("pOffsetY" , patternOffsetY);
writer.writeAttribute("pRotation", patternRotation);
+ writer.writeAttribute("pSkewX" , patternSkewX);
+ writer.writeAttribute("pSkewY" , patternSkewY);
}
else
{
@@ -2439,13 +2451,15 @@
if (!item->strokePattern().isEmpty())
{
writer.writeAttribute("patternS", item->strokePattern());
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
writer.writeAttribute("pScaleXS", patternScaleX);
writer.writeAttribute("pScaleYS", patternScaleY);
writer.writeAttribute("pOffsetXS", patternOffsetX);
writer.writeAttribute("pOffsetYS", patternOffsetY);
writer.writeAttribute("pRotationS", patternRotation);
+ writer.writeAttribute("pSkewXS" , patternSkewX);
+ writer.writeAttribute("pSkewYS" , patternSkewY);
}
if (item->asLatexFrame())
{
Index: scribus/pageitem_pathtext.cpp
===================================================================
--- scribus/pageitem_pathtext.cpp (revision 14259)
+++ scribus/pageitem_pathtext.cpp (revision 14260)
@@ -106,7 +106,7 @@
{
if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)))
{
- p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation);
+ p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation, patternStrokeSkewX, patternStrokeSkewY);
p->setStrokeMode(ScPainter::Pattern);
}
else if (GrTypeStroke > 0)
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h (revision 14259)
+++ scribus/pageitem.h (revision 14260)
@@ -695,7 +695,7 @@
QString pattern() const { return patternVal; }
/** @brief Get the pattern transformation matrix of the object */
- void patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation) const;
+ void patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation, double &skewX, double &skewY) const;
/**
* @brief Set the fill pattern of the object.
@@ -706,7 +706,7 @@
/**
* @brief Set the fill pattern transformation of the object.
*/
- void setPatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
+ void setPatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY);
/** @brief Get the (name of the) fill color of the object */
QString fillColor() const { return fillColorVal; }
@@ -776,7 +776,7 @@
QString strokePattern() const { return patternStrokeVal; }
/** @brief Get the stroke pattern transformation matrix of the object */
- void strokePatternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation) const;
+ void strokePatternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation, double &skewX, double &skewY) const;
/**
* @brief Set the stroke pattern of the object.
@@ -787,7 +787,7 @@
/**
* @brief Set the stroke pattern transformation of the object.
*/
- void setStrokePatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
+ void setStrokePatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY);
/** @brief Set the QColor for the line */
void setLineQColor();
@@ -1160,6 +1160,8 @@
double patternOffsetX;
double patternOffsetY;
double patternRotation;
+ double patternSkewX;
+ double patternSkewY;
/**
* @brief Fill color name
@@ -1348,6 +1350,8 @@
double patternStrokeOffsetX;
double patternStrokeOffsetY;
double patternStrokeRotation;
+ double patternStrokeSkewX;
+ double patternStrokeSkewY;
/**
@@ -1379,7 +1383,7 @@
void rotation(double); //Degrees rotation
void colors(QString, QString, double, double); //lineColor, fillColor, lineShade, fillShade
void gradientType(int); //Normal, horizontal, vertical, etc.
- void patternFill(QString, double, double, double, double, double);
+ void patternFill(QString, double, double, double, double, double, double, double);
void gradientColorUpdate(double, double, double, double, double, double); //Cpal updatespecialgradient
void transparency(double, double); //fillTransparency, lineTransparency
void blendmode(int, int); //fillBlendmode, lineBlendmode
Index: scribus/scribusstructs.h
===================================================================
--- scribus/scribusstructs.h (revision 14259)
+++ scribus/scribusstructs.h (revision 14260)
@@ -81,6 +81,8 @@
double patternOffsetX;
double patternOffsetY;
double patternRotation;
+ double patternSkewX;
+ double patternSkewY;
double GrStartX;
double GrStartY;
double GrEndX;
Index: scribus/scpageoutput.cpp
===================================================================
--- scribus/scpageoutput.cpp (revision 14259)
+++ scribus/scpageoutput.cpp (revision 14260)
@@ -379,10 +379,11 @@
{
QTransform patternTransform;
ScPattern& pattern = m_doc->docPatterns[item->pattern()];
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
patternTransform.translate(patternOffsetX, patternOffsetY);
patternTransform.rotate(patternRotation);
+ patternTransform.shear(patternSkewX, patternSkewY);
patternTransform.scale(pattern.scaleX, pattern.scaleY);
patternTransform.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
painter->setPattern(&pattern, patternTransform);
@@ -775,14 +776,15 @@
{
double x1, x2, y1, y2;
ScPattern& pattern = m_doc->docPatterns[item->pattern()];
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
// Compute pattern tansformation matrix and its inverse for converting pattern coordinates
// to pageitem coordinates
QTransform matrix, invMat;
matrix.translate(patternOffsetX, patternOffsetY);
matrix.rotate(patternRotation);
+ matrix.shear(patternSkewX, patternSkewY);
matrix.scale(pattern.scaleX, pattern.scaleY);
matrix.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
invMat.scale((patternScaleX != 0) ? (100 /patternScaleX) : 1.0, (patternScaleY != 0) ? (100 /patternScaleY) : 1.0);
Index: scribus/scpainter.cpp
===================================================================
--- scribus/scpainter.cpp (revision 14259)
+++ scribus/scpainter.cpp (revision 14260)
@@ -930,7 +930,7 @@
{
}
-void ScPainter::setPattern(ScPattern *pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation)
+void ScPainter::setPattern(ScPattern *pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY)
{
m_pattern = pattern;
patternScaleX = scaleX / 100.0;
@@ -938,6 +938,8 @@
patternOffsetX = offsetX;
patternOffsetY = offsetY;
patternRotation = rotation;
+ patternSkewX = skewX;
+ patternSkewY = skewY;
}
#ifdef HAVE_CAIRO
@@ -1004,6 +1006,7 @@
QTransform qmatrix;
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
+ qmatrix.shear(-patternSkewX, patternSkewY);
qmatrix.scale(patternScaleX, patternScaleY);
qmatrix.scale(m_pattern->width / static_cast<double>(m_pattern->getPattern()->width()), m_pattern->height / static_cast<double>(m_pattern->getPattern()->height()));
cairo_matrix_init(&matrix, qmatrix.m11(), qmatrix.m12(), qmatrix.m21(), qmatrix.m22(), qmatrix.dx(), qmatrix.dy());
@@ -1053,6 +1056,7 @@
qmatrix.translate(-LineWidth / 2.0, -LineWidth / 2.0);
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
+ qmatrix.shear(-patternSkewX, patternSkewY);
qmatrix.scale(patternScaleX, patternScaleY);
qmatrix.scale(m_pattern->width / static_cast<double>(m_pattern->getPattern()->width()), m_pattern->height / static_cast<double>(m_pattern->getPattern()->height()));
cairo_matrix_init(&matrix, qmatrix.m11(), qmatrix.m12(), qmatrix.m21(), qmatrix.m22(), qmatrix.dx(), qmatrix.dy());
@@ -1162,6 +1166,7 @@
QTransform qmatrix;
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
+ qmatrix.shear(-patternSkewX, patternSkewY);
qmatrix.scale(patternScaleX, patternScaleY);
qmatrix.scale(m_pattern->width / static_cast<double>(m_pattern->getPattern()->width()), m_pattern->height / static_cast<double>(m_pattern->getPattern()->height()));
QBrush brush = QBrush(*m_pattern->getPattern());
@@ -1215,6 +1220,7 @@
qmatrix.translate(-LineWidth / 2.0, -LineWidth / 2.0);
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
+ qmatrix.shear(-patternSkewX, patternSkewY);
qmatrix.scale(patternScaleX, patternScaleY);
qmatrix.scale(m_pattern->width / static_cast<double>(m_pattern->getPattern()->width()), m_pattern->height / static_cast<double>(m_pattern->getPattern()->height()));
QBrush brush = QBrush(*m_pattern->getPattern());
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (revision 14259)
+++ scribus/pageitem.cpp (revision 14260)
@@ -189,6 +189,8 @@
patternOffsetX(other.patternOffsetX),
patternOffsetY(other.patternOffsetY),
patternRotation(other.patternRotation),
+ patternSkewX(other.patternSkewX),
+ patternSkewY(other.patternSkewY),
fillColorVal(other.fillColorVal),
lineColorVal(other.lineColorVal),
lineShadeVal(other.lineShadeVal),
@@ -247,6 +249,8 @@
patternStrokeOffsetX(other.patternStrokeOffsetX),
patternStrokeOffsetY(other.patternStrokeOffsetY),
patternStrokeRotation(other.patternStrokeRotation),
+ patternStrokeSkewX(other.patternStrokeSkewX),
+ patternStrokeSkewY(other.patternStrokeSkewY),
gradientStrokeVal(other.gradientStrokeVal),
stroke_gradient(other.stroke_gradient),
GrTypeStroke(other.GrTypeStroke),
@@ -335,12 +339,16 @@
patternOffsetX = 0;
patternOffsetY = 0;
patternRotation = 0;
+ patternSkewX = 0;
+ patternSkewY = 0;
patternStrokeVal = "";
patternStrokeScaleX = 100;
patternStrokeScaleY = 100;
patternStrokeOffsetX = 0;
patternStrokeOffsetY = 0;
patternStrokeRotation = 0;
+ patternStrokeSkewX = 0;
+ patternStrokeSkewY = 0;
m_lineWidth = w2;
Oldm_lineWidth = w2;
PLineArt = Qt::PenStyle(m_Doc->itemToolPrefs.shapeLineStyle);
@@ -1108,7 +1116,7 @@
}
else
{
- p->setPattern(&m_Doc->docPatterns[patternVal], patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ p->setPattern(&m_Doc->docPatterns[patternVal], patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
p->setFillMode(ScPainter::Pattern);
}
}
@@ -1244,7 +1252,7 @@
{
if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)))
{
- p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation);
+ p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation, patternStrokeSkewX, patternStrokeSkewY);
p->setStrokeMode(ScPainter::Pattern);
p->strokePath();
}
@@ -2390,22 +2398,26 @@
GrStrokeEndY = endY;
}
-void PageItem::setPatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation)
+void PageItem::setPatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY)
{
patternScaleX = scaleX;
patternScaleY = scaleY;
patternOffsetX = offsetX;
patternOffsetY = offsetY;
patternRotation = rotation;
+ patternSkewX = skewX;
+ patternSkewY = skewY;
}
-void PageItem::patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation) const
+void PageItem::patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation, double &skewX, double &skewY) const
{
scaleX = patternScaleX;
scaleY = patternScaleY;
offsetX = patternOffsetX;
offsetY = patternOffsetY;
rotation = patternRotation;
+ skewX = patternSkewX;
+ skewY = patternSkewY;
}
void PageItem::setFillColor(const QString &newColor)
@@ -2588,22 +2600,26 @@
patternStrokeVal = newPattern;
}
-void PageItem::setStrokePatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation)
+void PageItem::setStrokePatternTransform(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY)
{
patternStrokeScaleX = scaleX;
patternStrokeScaleY = scaleY;
patternStrokeOffsetX = offsetX;
patternStrokeOffsetY = offsetY;
patternStrokeRotation = rotation;
+ patternStrokeSkewX = skewX;
+ patternStrokeSkewY = skewY;
}
-void PageItem::strokePatternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation) const
+void PageItem::strokePatternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation, double &skewX, double &skewY) const
{
scaleX = patternStrokeScaleX;
scaleY = patternStrokeScaleY;
offsetX = patternStrokeOffsetX;
offsetY = patternStrokeOffsetY;
rotation = patternStrokeRotation;
+ skewX = patternStrokeSkewX;
+ skewY = patternStrokeSkewY;
}
void PageItem::setLineQColor()
@@ -5156,7 +5172,7 @@
{
if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)))
{
- p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation);
+ p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation, patternStrokeSkewX, patternStrokeSkewY);
p->setFillMode(ScPainter::Pattern);
p->fillPath();
}
@@ -5485,7 +5501,7 @@
//CB unused in 135 connect(this, SIGNAL(colors(QString, QString, double, double)), m_Doc->scMW(), SLOT(setCSMenu()));
// connect(this, SIGNAL(colors(QString, QString, double, double)), pp->Cpal, SLOT(setActFarben(QString, QString, int, int)));
// connect(this, SIGNAL(gradientType(int)), pp->Cpal, SLOT(setActGradient(int)));
- connect(this, SIGNAL(patternFill(QString, double, double, double, double, double)), pp->Cpal, SLOT(setActPattern(QString, double, double, double, double, double)));
+ connect(this, SIGNAL(patternFill(QString, double, double, double, double, double, double, double)), pp->Cpal, SLOT(setActPattern(QString, double, double, double, double, double, double, double)));
// connect(this, SIGNAL(gradientColorUpdate(double, double, double, double, double, double)), pp->Cpal, SLOT(setSpecialGradient(double, double, double, double, double, double)));
connect(this, SIGNAL(rotation(double)), pp, SLOT(setR(double)));
// connect(this, SIGNAL(transparency(double, double)), pp->Cpal, SLOT(setActTrans(double, double)));
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h (revision 14259)
+++ scribus/scribusdoc.h (revision 14260)
@@ -1222,9 +1222,9 @@
void itemSelection_SetItemBrushShade(int sha);
void itemSelection_SetItemGradFill(int typ);
void itemSelection_SetItemPatternFill(QString pattern);
- void itemSelection_SetItemPatternProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
+ void itemSelection_SetItemPatternProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY);
void itemSelection_SetItemStrokePattern(QString pattern);
- void itemSelection_SetItemStrokePatternProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
+ void itemSelection_SetItemStrokePatternProps(double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY);
void undoRedoBegin();
void undoRedoDone();
Index: scribus/scribusview.cpp
===================================================================
--- scribus/scribusview.cpp (revision 14259)
+++ scribus/scribusview.cpp (revision 14260)
@@ -3830,7 +3830,7 @@
{
currItem->setPattern(Buffer->pattern);
currItem->GrType = Buffer->GrType;
- currItem->setPatternTransform(Buffer->patternScaleX, Buffer->patternScaleY, Buffer->patternOffsetX, Buffer->patternOffsetY, Buffer->patternRotation);
+ currItem->setPatternTransform(Buffer->patternScaleX, Buffer->patternScaleY, Buffer->patternOffsetX, Buffer->patternOffsetY, Buffer->patternRotation, Buffer->patternSkewX, Buffer->patternSkewY);
}
else
{
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp (revision 14259)
+++ scribus/pageitem_textframe.cpp (revision 14260)
@@ -2635,7 +2635,7 @@
}
if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)))
{
- p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation);
+ p->setPattern(&m_Doc->docPatterns[patternStrokeVal], patternStrokeScaleX, patternStrokeScaleY, patternStrokeOffsetX, patternStrokeOffsetY, patternStrokeRotation, patternStrokeSkewX, patternStrokeSkewY);
p->setStrokeMode(ScPainter::Pattern);
p->strokePath();
}
Index: scribus/ui/cpalette.cpp
===================================================================
--- scribus/ui/cpalette.cpp (revision 14259)
+++ scribus/ui/cpalette.cpp (revision 14260)
@@ -59,6 +59,7 @@
#include "scpainter.h"
#include "scpattern.h"
#include "util.h"
+#include "util_math.h"
GradientVectorDialog::GradientVectorDialog(QWidget* parent) : ScrPaletteBase( parent, "GradientVectorPalette", false, 0 )
{
@@ -176,6 +177,7 @@
textLabel6 = new QLabel( groupScale );
groupScaleLayout->addWidget( textLabel6, 1, 0 );
spinYscaling = new ScrSpinBox( 1, 500, groupScale, 0 );
+ spinYscaling->setValue( 100 );
groupScaleLayout->addWidget( spinYscaling, 1, 1 );
keepScaleRatio = new LinkButton( groupScale );
keepScaleRatio->setCheckable( true );
@@ -193,6 +195,24 @@
spinAngle = new ScrSpinBox( -180, 180, groupRotation, 6 );
groupRotationLayout->addWidget( spinAngle );
frame3Layout->addWidget( groupRotation );
+
+ groupSkew = new QGroupBox( this );
+ groupSkewLayout = new QGridLayout( groupSkew );
+ groupSkewLayout->setSpacing( 2 );
+ groupSkewLayout->setMargin( 3 );
+ groupSkewLayout->setAlignment( Qt::AlignTop );
+ textLabel8 = new QLabel( groupSkew );
+ groupSkewLayout->addWidget( textLabel8, 0, 0 );
+ spinXSkew = new ScrSpinBox( -89, 89, groupSkew, 6);
+ spinXSkew->setValue( 0 );
+ groupSkewLayout->addWidget( spinXSkew, 0, 1 );
+ textLabel9 = new QLabel( groupSkew );
+ groupSkewLayout->addWidget( textLabel9, 1, 0 );
+ spinYSkew = new ScrSpinBox( -89, 89, groupSkew, 6 );
+ spinYSkew->setValue( 0 );
+ groupSkewLayout->addWidget( spinYSkew, 1, 1 );
+ frame3Layout->addWidget( groupSkew );
+
buttonLayout = new QHBoxLayout;
buttonLayout->setMargin(0);
buttonLayout->setSpacing(5);
@@ -208,6 +228,8 @@
languageChange();
connect(spinXoffset, SIGNAL(valueChanged(double)), this, SLOT(changePatternProps()));
connect(spinYoffset, SIGNAL(valueChanged(double)), this, SLOT(changePatternProps()));
+ connect(spinXSkew, SIGNAL(valueChanged(double)), this, SLOT(changePatternProps()));
+ connect(spinYSkew, SIGNAL(valueChanged(double)), this, SLOT(changePatternProps()));
connect(spinXscaling, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
connect(spinYscaling, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
connect(keepScaleRatio, SIGNAL(clicked()), this, SLOT(ToggleKette()));
@@ -241,6 +263,9 @@
textLabel6->setText( tr( "Y-Scale:" ) );
spinYscaling->setSuffix( pctSuffix );
groupRotation->setTitle( tr( "Rotation" ) );
+ groupSkew->setTitle( tr( "Skewing" ) );
+ textLabel8->setText( tr( "X-Skew:" ) );
+ textLabel9->setText( tr( "Y-Skew:" ) );
textLabel7->setText( tr( "Angle" ) );
buttonOk->setText( tr("Close"));
resize(minimumSizeHint());
@@ -248,7 +273,11 @@
void PatternPropsDialog::changePatternProps()
{
- emit NewPatternProps(spinXscaling->value(), spinYscaling->value(), spinXoffset->value(), spinYoffset->value(), spinAngle->value());
+ double a = M_PI / 180.0 * spinXSkew->value();
+ double b = M_PI / 180.0 * spinYSkew->value();
+ double sina = tan(a);
+ double sinb = tan(b);
+ emit NewPatternProps(spinXscaling->value(), spinYscaling->value(), spinXoffset->value(), spinYoffset->value(), spinAngle->value(), sina, sinb);
}
void PatternPropsDialog::ToggleKette()
@@ -710,7 +739,7 @@
emit NewPatternS(c->text());
}
-void Cpalette::setActPatternStroke(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation)
+void Cpalette::setActPatternStroke(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY)
{
disconnect(patternBoxStroke, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPatternS(QListWidgetItem*)));
QList<QListWidgetItem*> itl = patternBoxStroke->findItems(pattern, Qt::MatchExactly);
@@ -726,10 +755,12 @@
m_Pattern_offsetXS = offsetX;
m_Pattern_offsetYS = offsetY;
m_Pattern_rotationS = rotation;
+ m_Pattern_skewXS = skewX;
+ m_Pattern_skewYS = skewY;
connect(patternBoxStroke, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPatternS(QListWidgetItem*)));
}
-void Cpalette::setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation)
+void Cpalette::setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY)
{
disconnect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*)));
QList<QListWidgetItem*> itl = patternBox->findItems(pattern, Qt::MatchExactly);
@@ -745,6 +776,8 @@
m_Pattern_offsetX = offsetX;
m_Pattern_offsetY = offsetY;
m_Pattern_rotation = rotation;
+ m_Pattern_skewX = skewX;
+ m_Pattern_skewY = skewY;
connect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*)));
}
@@ -923,13 +956,23 @@
dia->spinXoffset->setValue(m_Pattern_offsetX);
dia->spinYoffset->setValue(m_Pattern_offsetY);
dia->spinAngle->setValue(m_Pattern_rotation);
- connect(dia, SIGNAL(NewPatternProps(double, double, double, double, double)), this, SIGNAL(NewPatternProps(double, double, double, double, double)));
+ double asina = atan(m_Pattern_skewX);
+ dia->spinXSkew->setValue(asina / (M_PI / 180.0));
+ double asinb = atan(m_Pattern_skewY);
+ dia->spinYSkew->setValue(asinb / (M_PI / 180.0));
+ connect(dia, SIGNAL(NewPatternProps(double, double, double, double, double, double, double)), this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double)));
dia->exec();
m_Pattern_scaleX = dia->spinXscaling->value();
m_Pattern_scaleY = dia->spinYscaling->value();
m_Pattern_offsetX = dia->spinXoffset->value();
m_Pattern_offsetY = dia->spinYoffset->value();
m_Pattern_rotation = dia->spinAngle->value();
+ double a = M_PI / 180.0 * dia->spinXSkew->value();
+ double b = M_PI / 180.0 * dia->spinYSkew->value();
+ double sina = tan(a);
+ double sinb = tan(b);
+ m_Pattern_skewX = sina;
+ m_Pattern_skewY = sinb;
delete dia;
tabWidget->setCurrentIndex(2);
emit NewGradient(8);
@@ -943,13 +986,23 @@
dia->spinXoffset->setValue(m_Pattern_offsetXS);
dia->spinYoffset->setValue(m_Pattern_offsetYS);
dia->spinAngle->setValue(m_Pattern_rotationS);
- connect(dia, SIGNAL(NewPatternProps(double, double, double, double, double)), this, SIGNAL(NewPatternPropsS(double, double, double, double, double)));
+ double asina = atan(m_Pattern_skewXS);
+ dia->spinXSkew->setValue(asina / (M_PI / 180.0));
+ double asinb = atan(m_Pattern_skewYS);
+ dia->spinYSkew->setValue(asinb / (M_PI / 180.0));
+ connect(dia, SIGNAL(NewPatternProps(double, double, double, double, double double, double)), this, SIGNAL(NewPatternPropsS(double, double, double, double, double double, double)));
dia->exec();
m_Pattern_scaleXS = dia->spinXscaling->value();
m_Pattern_scaleYS = dia->spinYscaling->value();
m_Pattern_offsetXS = dia->spinXoffset->value();
m_Pattern_offsetYS = dia->spinYoffset->value();
m_Pattern_rotationS = dia->spinAngle->value();
+ double a = M_PI / 180.0 * dia->spinXSkew->value();
+ double b = M_PI / 180.0 * dia->spinYSkew->value();
+ double sina = tan(a);
+ double sinb = tan(b);
+ m_Pattern_skewXS = sina;
+ m_Pattern_skewYS = sinb;
delete dia;
}
@@ -969,70 +1022,3 @@
else
QWidget::changeEvent(e);
}
-
-/*
-void Cpalette::languageChange()
-{
- QString ptSuffix=tr(" pt");
- QString pctSuffix=tr(" %");
- PM1->setSuffix(pctSuffix);
- TransSpin->setSuffix(pctSuffix);
- groupOffset->setTitle( tr( "Offsets" ) );
- textLabel1->setText( tr( "X:" ) );
- spinXoffset->setSuffix( ptSuffix );
- textLabel2->setText( tr( "Y:" ) );
- spinYoffset->setSuffix( ptSuffix );
- groupScale->setTitle( tr( "Scaling" ) );
- textLabel5->setText( tr( "X-Scale:" ) );
- spinXscaling->setSuffix( pctSuffix );
- textLabel6->setText( tr( "Y-Scale:" ) );
- spinYscaling->setSuffix( pctSuffix );
- groupRotation->setTitle( tr( "Rotation" ) );
- textLabel7->setText( tr( "Angle" ) );
-
- ShadeTxt->setText( tr( "Shade:" ) );
- TransTxt->setText( tr( "Opacity:" ) );
- gradEditButton->setText( tr("Move Vector"));
-
- int oldGradient=gradientQCombo->currentIndex();
- gradientQCombo->clear();
- gradientQCombo->addItem( tr("Normal"));
- gradientQCombo->addItem( tr("Horizontal Gradient"));
- gradientQCombo->addItem( tr("Vertical Gradient"));
- gradientQCombo->addItem( tr("Diagonal Gradient"));
- gradientQCombo->addItem( tr("Cross Diagonal Gradient"));
- gradientQCombo->addItem( tr("Radial Gradient"));
- gradientQCombo->addItem( tr("Free linear Gradient"));
- gradientQCombo->addItem( tr("Free radial Gradient"));
- gradientQCombo->addItem( tr("Pattern"));
- gradientQCombo->setCurrentIndex(oldGradient);
- TransGroup->setTitle( tr( "Transparency Settings" ));
- TransTxt2->setText( tr( "Blend Mode:" ) );
- blendMode->clear();
- blendMode->addItem( tr("Normal"));
- blendMode->addItem( tr("Darken"));
- blendMode->addItem( tr("Lighten"));
- blendMode->addItem( tr("Multiply"));
- blendMode->addItem( tr("Screen"));
- blendMode->addItem( tr("Overlay"));
- blendMode->addItem( tr("Hard Light"));
- blendMode->addItem( tr("Soft Light"));
- blendMode->addItem( tr("Difference"));
- blendMode->addItem( tr("Exclusion"));
- blendMode->addItem( tr("Color Dodge"));
- blendMode->addItem( tr("Color Burn"));
- blendMode->addItem( tr("Hue"));
- blendMode->addItem( tr("Saturation"));
- blendMode->addItem( tr("Color"));
- blendMode->addItem( tr("Luminosity"));
- displayAllColors->setText( tr( "Display only used Colors" ));
-
- editLineColorSelector->setToolTip( tr( "Edit Line Color Properties" ) );
- editFillColorSelector->setToolTip( tr( "Edit Fill Color Properties" ) );
- PM1->setToolTip( tr( "Saturation of color" ) );
- gradientQCombo->setToolTip( tr( "Normal or gradient fill method" ) );
- TransSpin->setToolTip( tr( "Set the transparency for the color selected" ) );
- gradEditButton->setToolTip( "<qt>" + tr( "Move the start of the gradient vector with the left mouse button pressed and move the end of the gradient vector with the right mouse button pressed" ) + "</qt>");
- displayAllColors->setToolTip( "<qt>" + tr( "Display all colors from the document color list, or only the already used colors" ) + "</qt>");
-}
-*/
Index: scribus/ui/cpalette.h
===================================================================
--- scribus/ui/cpalette.h (revision 14259)
+++ scribus/ui/cpalette.h (revision 14260)
@@ -88,6 +88,8 @@
ScrSpinBox* spinXscaling;
ScrSpinBox* spinYscaling;
ScrSpinBox* spinAngle;
+ ScrSpinBox* spinXSkew;
+ ScrSpinBox* spinYSkew;
public slots:
void languageChange();
@@ -97,7 +99,7 @@
void VChange();
signals:
- void NewPatternProps(double, double, double, double, double);
+ void NewPatternProps(double, double, double, double, double, double, double);
protected:
QGroupBox* groupOffset;
@@ -109,9 +111,13 @@
LinkButton* keepScaleRatio;
QGroupBox* groupRotation;
QLabel* textLabel7;
+ QGroupBox* groupSkew;
+ QLabel* textLabel8;
+ QLabel* textLabel9;
QVBoxLayout* frame3Layout;
QHBoxLayout* groupOffsetLayout;
QGridLayout* groupScaleLayout;
+ QGridLayout* groupSkewLayout;
QHBoxLayout* groupRotationLayout;
QPushButton* buttonOk;
QHBoxLayout* buttonLayout;
@@ -152,8 +158,8 @@
void selectPatternS(QListWidgetItem *c);
void updatePatternList();
void updateGradientList();
- void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
- void setActPatternStroke(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
+ void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY);
+ void setActPatternStroke(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY);
void setActFarben(QString p, QString b, int shp, int shb);
void selectColorS(QListWidgetItem *c);
void selectColorF(QListWidgetItem *c);
@@ -178,9 +184,9 @@
void NewGradient(int);
void NewGradientS(int);
void NewPattern(QString);
- void NewPatternProps(double, double, double, double, double);
+ void NewPatternProps(double, double, double, double, double, double, double);
void NewPatternS(QString);
- void NewPatternPropsS(double, double, double, double, double);
+ void NewPatternPropsS(double, double, double, double, double, double, double);
void NewSpecial(double, double, double, double);
void NewTrans(double);
void NewTransS(double);
@@ -204,11 +210,15 @@
double m_Pattern_offsetX;
double m_Pattern_offsetY;
double m_Pattern_rotation;
+ double m_Pattern_skewX;
+ double m_Pattern_skewY;
double m_Pattern_scaleXS;
double m_Pattern_scaleYS;
double m_Pattern_offsetXS;
double m_Pattern_offsetYS;
double m_Pattern_rotationS;
+ double m_Pattern_skewXS;
+ double m_Pattern_skewYS;
int currentUnit;
bool editStrokeGradient;
};
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp (revision 14259)
+++ scribus/ui/propertiespalette.cpp (revision 14260)
@@ -1870,10 +1870,10 @@
disconnect(this->Cpal, SIGNAL(NewBlend(int)), 0, 0);
disconnect(this->Cpal, SIGNAL(NewBlendS(int)), 0, 0);
disconnect(this->Cpal, SIGNAL(NewPattern(QString)), 0, 0);
- disconnect(this->Cpal, SIGNAL(NewPatternProps(double, double, double, double, double)), 0, 0);
+ disconnect(this->Cpal, SIGNAL(NewPatternProps(double, double, double, double, double, double, double)), 0, 0);
disconnect(this->Cpal, SIGNAL(NewOverprint(int)), 0, 0);
disconnect(this->Cpal, SIGNAL(NewPatternS(QString)), 0, 0);
- disconnect(this->Cpal, SIGNAL(NewPatternPropsS(double, double, double, double, double)), 0, 0);
+ disconnect(this->Cpal, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double)), 0, 0);
doc = d;
CurItem = NULL;
@@ -1948,10 +1948,10 @@
connect(this->Cpal, SIGNAL(NewGradient(int)), doc, SLOT(itemSelection_SetItemGradFill(int)));
connect(this->Cpal, SIGNAL(NewGradientS(int)), doc, SLOT(itemSelection_SetItemGradStroke(int)));
connect(this->Cpal, SIGNAL(NewPattern(QString)), doc, SLOT(itemSelection_SetItemPatternFill(QString)));
- connect(this->Cpal, SIGNAL(NewPatternProps(double, double, double, double, double)), doc, SLOT(itemSelection_SetItemPatternProps(double, double, double, double, double)));
+ connect(this->Cpal, SIGNAL(NewPatternProps(double, double, double, double, double, double, double)), doc, SLOT(itemSelection_SetItemPatternProps(double, double, double, double, double, double, double)));
connect(this->Cpal, SIGNAL(NewOverprint(int)), this, SLOT(handleOverprint(int)));
connect(this->Cpal, SIGNAL(NewPatternS(QString)), doc, SLOT(itemSelection_SetItemStrokePattern(QString)));
- connect(this->Cpal, SIGNAL(NewPatternPropsS(double, double, double, double, double)), doc, SLOT(itemSelection_SetItemStrokePatternProps(double, double, double, double, double)));
+ connect(this->Cpal, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double)), doc, SLOT(itemSelection_SetItemStrokePatternProps(double, double, double, double, double, double, double)));
}
void PropertiesPalette::unsetDoc()
@@ -2231,11 +2231,11 @@
Rotation->setValue(fabs(rr));
// setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
setTextToFrameDistances(i->textToFrameDistLeft(),i->textToFrameDistTop(),i->textToFrameDistBottom(),i->textToFrameDistRight());
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- i->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
- Cpal->setActPattern(i->pattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
- i->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
- Cpal->setActPatternStroke(i->strokePattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ i->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
+ Cpal->setActPattern(i->pattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
+ i->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
+ Cpal->setActPatternStroke(i->strokePattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
//CB TODO reconnect PP signals from here
connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
Index: scribus/plugins/pctimplugin/importpct.cpp
===================================================================
--- scribus/plugins/pctimplugin/importpct.cpp (revision 14259)
+++ scribus/plugins/pctimplugin/importpct.cpp (revision 14260)
@@ -930,7 +930,7 @@
alignStreamToWord(ts, dataLenLong);
break;
default:
- qDebug() << QString("Not implemented OpCode: 0x%1 at %3").arg(opCode, 4, 16, QLatin1Char('0')).arg(ts.device()->pos()-2);
+ qDebug() << QString("Not implemented OpCode: 0x%1 at %2").arg(opCode, 4, 16, QLatin1Char('0')).arg(ts.device()->pos()-2);
return;
break;
}
Index: scribus/plugins/aiimplugin/importai.cpp
===================================================================
--- scribus/plugins/aiimplugin/importai.cpp (revision 14259)
+++ scribus/plugins/aiimplugin/importai.cpp (revision 14260)
@@ -1171,14 +1171,14 @@
if (!currentPatternName.isEmpty())
{
ite->setPattern(currentPatternName);
- ite->setPatternTransform(currentPatternXScale * 100, currentPatternYScale * 100, currentPatternX, currentPatternY, currentPatternRotation);
+ ite->setPatternTransform(currentPatternXScale * 100, currentPatternYScale * 100, currentPatternX, currentPatternY, currentPatternRotation, 0.0, 0.0);
ite->GrType = 8;
currentPatternName = "";
}
if (!currentStrokePatternName.isEmpty())
{
ite->setStrokePattern(currentStrokePatternName);
- ite->setStrokePatternTransform(currentStrokePatternXScale * 100, currentStrokePatternYScale * 100, currentStrokePatternX, currentStrokePatternY, currentStrokePatternRotation);
+ ite->setStrokePatternTransform(currentStrokePatternXScale * 100, currentStrokePatternYScale * 100, currentStrokePatternX, currentStrokePatternY, currentStrokePatternRotation, 0.0, 0.0);
currentStrokePatternName = "";
}
ite->setLineEnd(CapStyle);
Index: scribus/plugins/tools/lenseffects/lensdialog.cpp
===================================================================
--- scribus/plugins/tools/lenseffects/lensdialog.cpp (revision 14259)
+++ scribus/plugins/tools/lenseffects/lensdialog.cpp (revision 14260)
@@ -333,11 +333,12 @@
}
else if ((currItem->GrType == 8) && (!currItem->pattern().isEmpty()) && (doc->docPatterns.contains(currItem->pattern())))
{
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
QTransform qmatrix;
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
+ qmatrix.shear(patternSkewX, patternSkewY);
qmatrix.scale(patternScaleX / 100.0, patternScaleY / 100.0);
QImage pat = *doc->docPatterns[currItem->pattern()].getPattern();
QBrush brush = QBrush(pat);
@@ -358,12 +359,13 @@
{
if ((!currItem->strokePattern().isEmpty()) && (doc->docPatterns.contains(currItem->strokePattern())))
{
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- currItem->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ currItem->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
QTransform qmatrix;
qmatrix.translate(-currItem->lineWidth() / 2.0, -currItem->lineWidth() / 2.0);
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
+ qmatrix.shear(patternSkewX, patternSkewY);
qmatrix.scale(patternScaleX / 100.0, patternScaleY / 100.0);
QImage pat = *doc->docPatterns[currItem->strokePattern()].getPattern();
QBrush brush = QBrush(pat);
Index: scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
===================================================================
--- scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp (revision 14259)
+++ scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp (revision 14260)
@@ -220,11 +220,12 @@
}
else if ((currItem->GrType == 8) && (!currItem->pattern().isEmpty()) && (doc->docPatterns.contains(currItem->pattern())))
{
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
QTransform qmatrix;
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
+ qmatrix.shear(patternSkewX, patternSkewY);
qmatrix.scale(patternScaleX / 100.0, patternScaleY / 100.0);
QImage pat = *doc->docPatterns[currItem->pattern()].getPattern();
QBrush brush = QBrush(pat);
@@ -245,12 +246,13 @@
{
if ((!currItem->strokePattern().isEmpty()) && (doc->docPatterns.contains(currItem->strokePattern())))
{
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- currItem->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ currItem->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
QTransform qmatrix;
qmatrix.translate(-currItem->lineWidth() / 2.0, -currItem->lineWidth() / 2.0);
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
+ qmatrix.shear(patternSkewX, patternSkewY);
qmatrix.scale(patternScaleX / 100.0, patternScaleY / 100.0);
QImage pat = *doc->docPatterns[currItem->strokePattern()].getPattern();
QBrush brush = QBrush(pat);
Index: scribus/plugins/svgimplugin/svgplugin.cpp
===================================================================
--- scribus/plugins/svgimplugin/svgplugin.cpp (revision 14259)
+++ scribus/plugins/svgimplugin/svgplugin.cpp (revision 14260)
@@ -640,7 +640,7 @@
mm.rotate(rot);
double patDx = (item->xPos() - BaseX) - mm.dx();
double patDy = (item->yPos() - BaseY) - mm.dy();
- item->setPatternTransform(mm.m11() * 100.0, mm.m22() * 100.0, patDx, patDy, -rot);
+ item->setPatternTransform(mm.m11() * 100.0, mm.m22() * 100.0, patDx, patDy, -rot, 0, 0);
}
else
{
@@ -711,7 +711,7 @@
mm.rotate(rot);
double patDx = (item->xPos() - BaseX) - mm.dx();
double patDy = (item->yPos() - BaseY) - mm.dy();
- item->setStrokePatternTransform(mm.m11() * 100.0, mm.m22() * 100.0, patDx, patDy, -rot);
+ item->setStrokePatternTransform(mm.m11() * 100.0, mm.m22() * 100.0, patDx, patDy, -rot, 0, 0);
}
else
{
Index: scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (revision 14259)
+++ scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (revision 14260)
@@ -1169,13 +1169,15 @@
if (item->GrType == 8)
{
docu.writeAttribute("pattern", item->pattern());
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
docu.writeAttribute("pScaleX", patternScaleX);
docu.writeAttribute("pScaleY", patternScaleY);
docu.writeAttribute("pOffsetX", patternOffsetX);
docu.writeAttribute("pOffsetY", patternOffsetY);
docu.writeAttribute("pRotation", patternRotation);
+ docu.writeAttribute("pSkewX", patternSkewX);
+ docu.writeAttribute("pSkewY", patternSkewY);
}
else
{
@@ -1199,13 +1201,15 @@
if (!item->strokePattern().isEmpty())
{
docu.writeAttribute("patternS", item->strokePattern());
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
docu.writeAttribute("pScaleXS", patternScaleX);
docu.writeAttribute("pScaleYS", patternScaleY);
docu.writeAttribute("pOffsetXS", patternOffsetX);
docu.writeAttribute("pOffsetYS", patternOffsetY);
docu.writeAttribute("pRotationS", patternRotation);
+ docu.writeAttribute("pSkewXS", patternSkewX);
+ docu.writeAttribute("pSkewYS", patternSkewY);
}
if (item->itemText.defaultStyle().hasParent())
docu.writeAttribute("PSTYLE", item->itemText.defaultStyle().parent());
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp (revision 14259)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp (revision 14260)
@@ -2761,7 +2761,9 @@
double patternOffsetX = attrs.valueAsDouble("pOffsetX", 0.0);
double patternOffsetY = attrs.valueAsDouble("pOffsetY", 0.0);
double patternRotation = attrs.valueAsDouble("pRotation", 0.0);
- currItem->setPatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternSkewX = attrs.valueAsDouble("pSkewX", 0.0);
+ double patternSkewY = attrs.valueAsDouble("pSkewY", 0.0);
+ currItem->setPatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
}
else
{
@@ -2814,7 +2816,9 @@
double patternOffsetX = attrs.valueAsDouble("pOffsetXS", 0.0);
double patternOffsetY = attrs.valueAsDouble("pOffsetYS", 0.0);
double patternRotation = attrs.valueAsDouble("pRotationS", 0.0);
- currItem->setStrokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternSkewX = attrs.valueAsDouble("pSkewXS", 0.0);
+ double patternSkewY = attrs.valueAsDouble("pSkewYS", 0.0);
+ currItem->setStrokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
currItem->stroke_gradient.clearStops();
currItem->GrTypeStroke = attrs.valueAsInt("GRTYPS", 0);
currItem->GrStrokeStartX = attrs.valueAsDouble("GRSTARTXS", 0.0);
Index: scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp (revision 14259)
+++ scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp (revision 14260)
@@ -1144,8 +1144,8 @@
if (item->GrType == 8)
{
docu.writeAttribute("pattern", item->pattern());
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
docu.writeAttribute("pScaleX", patternScaleX);
docu.writeAttribute("pScaleY", patternScaleY);
docu.writeAttribute("pOffsetX", patternOffsetX);
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp (revision 14259)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp (revision 14260)
@@ -2791,7 +2791,7 @@
double patternOffsetX = attrs.valueAsDouble("pOffsetX", 0.0);
double patternOffsetY = attrs.valueAsDouble("pOffsetY", 0.0);
double patternRotation = attrs.valueAsDouble("pRotation", 0.0);
- currItem->setPatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ currItem->setPatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, 0, 0);
}
else
{
Index: scribus/plugins/svgexplugin/svgexplugin.cpp
===================================================================
--- scribus/plugins/svgexplugin/svgexplugin.cpp (revision 14259)
+++ scribus/plugins/svgexplugin/svgexplugin.cpp (revision 14260)
@@ -1291,12 +1291,13 @@
patt.setAttribute("height", pa.height);
patt.setAttribute("width", pa.width);
patt.setAttribute("patternUnits", "userSpaceOnUse");
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- Item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ Item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
QTransform mpa;
mpa.translate(-Item->lineWidth() / 2.0, -Item->lineWidth() / 2.0);
mpa.translate(patternOffsetX, patternOffsetY);
mpa.rotate(patternRotation);
+ mpa.shear(-patternSkewX, patternSkewY);
mpa.scale(pa.scaleX, pa.scaleY);
mpa.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
patt.setAttribute("patternTransform", MatrixToStr(mpa));
@@ -1439,12 +1440,13 @@
patt.setAttribute("height", pa.height);
patt.setAttribute("width", pa.width);
patt.setAttribute("patternUnits", "userSpaceOnUse");
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- Item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ Item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
QTransform mpa;
mpa.translate(-Item->lineWidth() / 2.0, -Item->lineWidth() / 2.0);
mpa.translate(patternOffsetX, patternOffsetY);
mpa.rotate(patternRotation);
+ mpa.shear(-patternSkewX, patternSkewY);
mpa.scale(pa.scaleX, pa.scaleY);
mpa.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
patt.setAttribute("patternTransform", MatrixToStr(mpa));
@@ -1546,14 +1548,15 @@
ScPattern pa = m_Doc->docPatterns[Item->pattern()];
QDomElement patt = docu.createElement("pattern");
patt.setAttribute("id", pattID);
- patt.setAttribute("height", pa.height);
- patt.setAttribute("width", pa.width);
+ patt.setAttribute("height", FToStr(pa.height));
+ patt.setAttribute("width", FToStr(pa.width));
patt.setAttribute("patternUnits", "userSpaceOnUse");
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- Item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ Item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
QTransform mpa;
mpa.translate(patternOffsetX, patternOffsetY);
mpa.rotate(patternRotation);
+ mpa.shear(-patternSkewX, patternSkewY);
mpa.scale(pa.scaleX, pa.scaleY);
mpa.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
patt.setAttribute("patternTransform", MatrixToStr(mpa));
@@ -1652,8 +1655,8 @@
ScPattern pa = m_Doc->docPatterns[patterns[c]];
QDomElement patt = docu.createElement("pattern");
patt.setAttribute("id", patterns[c]);
- patt.setAttribute("height", pa.height);
- patt.setAttribute("width", pa.width);
+ patt.setAttribute("height", FToStr(pa.height));
+ patt.setAttribute("width", FToStr(pa.width));
for (int em = 0; em < pa.items.count(); ++em)
{
PageItem* Item = pa.items.at(em);
@@ -1795,15 +1798,16 @@
ScPattern pa = m_Doc->docPatterns[Item->strokePattern()];
QDomElement patt = docu.createElement("pattern");
patt.setAttribute("id", pattID);
- patt.setAttribute("height", pa.height);
- patt.setAttribute("width", pa.width);
+ patt.setAttribute("height", FToStr(pa.height));
+ patt.setAttribute("width", FToStr(pa.width));
patt.setAttribute("patternUnits", "userSpaceOnUse");
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- Item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ Item->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
QTransform mpa;
mpa.translate(-Item->lineWidth() / 2.0, -Item->lineWidth() / 2.0);
mpa.translate(patternOffsetX, patternOffsetY);
mpa.rotate(patternRotation);
+ mpa.shear(-patternSkewX, patternSkewY);
mpa.scale(pa.scaleX, pa.scaleY);
mpa.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
patt.setAttribute("patternTransform", MatrixToStr(mpa));
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp (revision 14259)
+++ scribus/pslib.cpp (revision 14260)
@@ -3436,13 +3436,14 @@
{
ScPattern *pat;
QTransform patternMatrix;
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
pat = &m_Doc->docPatterns[c->strokePattern()];
uint patHash = qHash(c->strokePattern());
- c->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ c->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
patternMatrix.translate(-c->lineWidth() / 2.0, c->lineWidth() / 2.0);
patternMatrix.translate(patternOffsetX, -patternOffsetY);
patternMatrix.rotate(-patternRotation);
+ patternMatrix.shear(patternSkewX, -patternSkewY);
patternMatrix.scale(pat->scaleX, pat->scaleY);
patternMatrix.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
PutStream("Pattern"+QString::number(patHash)+" ["+ToStr(patternMatrix.m11())+" "+ToStr(patternMatrix.m12())+" "+ToStr(patternMatrix.m21())+" "+ToStr(patternMatrix.m22())+" "+ToStr(patternMatrix.dx())+" "+ToStr(patternMatrix.dy())+"] makepattern setpattern\n");
@@ -3479,12 +3480,13 @@
if (GType == 8)
{
QTransform patternMatrix;
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
ScPattern *pat = &m_Doc->docPatterns[c->pattern()];
uint patHash = qHash(c->pattern());
- c->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ c->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
patternMatrix.translate(patternOffsetX, -patternOffsetY);
patternMatrix.rotate(-patternRotation);
+ patternMatrix.shear(patternSkewX, -patternSkewY);
patternMatrix.scale(pat->scaleX, pat->scaleY);
patternMatrix.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
PutStream("Pattern"+QString::number(patHash)+" ["+ToStr(patternMatrix.m11())+" "+ToStr(patternMatrix.m12())+" "+ToStr(patternMatrix.m21())+" "+ToStr(patternMatrix.m22())+" "+ToStr(patternMatrix.dx())+" "+ToStr(patternMatrix.dy())+"] makepattern setpattern\n");
@@ -3710,7 +3712,7 @@
double EndY =0;
ScPattern *pat;
QTransform patternMatrix;
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
QList<VColorStop*> cstops = c->fill_gradient.colorStops();
switch (c->GrType)
{
@@ -3729,9 +3731,10 @@
case 8:
pat = &m_Doc->docPatterns[c->pattern()];
uint patHash = qHash(c->pattern());
- c->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ c->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
patternMatrix.translate(patternOffsetX, -patternOffsetY);
patternMatrix.rotate(-patternRotation);
+ patternMatrix.shear(patternSkewX, -patternSkewY);
patternMatrix.scale(pat->scaleX, pat->scaleY);
patternMatrix.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
PutStream("Pattern"+QString::number(patHash)+" ["+ToStr(patternMatrix.m11())+" "+ToStr(patternMatrix.m12())+" "+ToStr(patternMatrix.m21())+" "+ToStr(patternMatrix.m22())+" "+ToStr(patternMatrix.dx())+" "+ToStr(patternMatrix.dy())+"] makepattern setpattern\n");
@@ -3828,12 +3831,13 @@
SetClipPath(&arrow);
PS_closepath();
QTransform patternMatrix;
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
ScPattern *pat = &m_Doc->docPatterns[ite->strokePattern()];
uint patHash = qHash(ite->strokePattern());
- ite->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ ite->strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
patternMatrix.translate(patternOffsetX, -patternOffsetY);
patternMatrix.rotate(-patternRotation);
+ patternMatrix.shear(patternSkewX, -patternSkewY);
patternMatrix.scale(pat->scaleX, pat->scaleY);
patternMatrix.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
PutStream("Pattern"+QString::number(patHash)+" ["+ToStr(patternMatrix.m11())+" "+ToStr(patternMatrix.m12())+" "+ToStr(patternMatrix.m21())+" "+ToStr(patternMatrix.m22())+" "+ToStr(patternMatrix.dx())+" "+ToStr(patternMatrix.dy())+"] makepattern setpattern\n");
Index: scribus/pageitem_desaxe.cpp
===================================================================
--- scribus/pageitem_desaxe.cpp (revision 14259)
+++ scribus/pageitem_desaxe.cpp (revision 14260)
@@ -261,13 +261,15 @@
{
Xml_attr patt;
patt.insert("patternS", strokePattern());
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ strokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
patt.insert("pScaleXS", toXMLString(patternScaleX));
patt.insert("pScaleYS", toXMLString(patternScaleY));
patt.insert("pOffsetXS", toXMLString(patternOffsetX));
patt.insert("pOffsetYS", toXMLString(patternOffsetY));
patt.insert("pRotationS", toXMLString(patternRotation));
+ patt.insert("pSkewXS", toXMLString(patternSkewX));
+ patt.insert("pSkewYS", toXMLString(patternSkewY));
handler.begin("PatternStroke", patt);
handler.end("PatternStroke");
}
@@ -277,13 +279,15 @@
{
Xml_attr patt;
patt.insert("pattern", pattern());
- double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
- patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
+ patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
patt.insert("pScaleX", toXMLString(patternScaleX));
patt.insert("pScaleY", toXMLString(patternScaleY));
patt.insert("pOffsetX", toXMLString(patternOffsetX));
patt.insert("pOffsetY", toXMLString(patternOffsetY));
patt.insert("pRotation", toXMLString(patternRotation));
+ patt.insert("pSkewX", toXMLString(patternSkewX));
+ patt.insert("pSkewY", toXMLString(patternSkewY));
handler.begin("Pattern", patt);
handler.end("Pattern");
}
@@ -583,8 +587,10 @@
double patternOffsetX = parseDouble(attr["pOffsetX"]);
double patternOffsetY = parseDouble(attr["pOffsetY"]);
double patternRotation = parseDouble(attr["pRotation"]);
+ double patternSkewX = parseDouble(attr["pSkewX"]);
+ double patternSkewY = parseDouble(attr["pSkewY"]);
item->setPattern(attr["pattern"]);
- item->setPatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ item->setPatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
}
};
@@ -602,8 +608,10 @@
double patternOffsetX = parseDouble(attr["pOffsetXS"]);
double patternOffsetY = parseDouble(attr["pOffsetYS"]);
double patternRotation = parseDouble(attr["pRotationS"]);
+ double patternSkewX = parseDouble(attr["pSkewXS"]);
+ double patternSkewY = parseDouble(attr["pSkewYS"]);
item->setStrokePattern(attr["patternS"]);
- item->setStrokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
+ item->setStrokePatternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
}
};
Index: scribus/scpainter.h
===================================================================
--- scribus/scpainter.h (revision 14259)
+++ scribus/scpainter.h (revision 14260)
@@ -70,7 +70,7 @@
virtual void setFillMode( int fill );
virtual void setStrokeMode( int stroke );
virtual void setGradient( VGradient::VGradientType mode, FPoint orig, FPoint vec, FPoint foc = FPoint(0,0));
- virtual void setPattern(ScPattern *pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation);
+ virtual void setPattern(ScPattern *pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY);
virtual void setClipPath();
virtual void drawImage( QImage *image );
@@ -154,6 +154,8 @@
double patternOffsetX;
double patternOffsetY;
double patternRotation;
+ double patternSkewX;
+ double patternSkewY;
/*! \brief Stroking */
QColor m_stroke;
double stroke_trans;
More information about the scribus-commit
mailing list