r14854 by fschmid - Gradient and Pattern Masks are supported for Groups now.
scribus-commit
scribus-commit at lists.scribus.net
Sun Mar 7 20:40:56 CET 2010
Revision: 14854
Author: fschmid
Date: 2010-03-07T19:39:26.115329Z
Commit message: Gradient and Pattern Masks are supported for Groups now.
Changeset:
M /trunk/Scribus/scribus/pdflib_core.cpp
M /trunk/Scribus/scribus/scpainter.cpp
M /trunk/Scribus/scribus/ui/propertiespalette.cpp
M /trunk/Scribus/scribus/scribus.cpp
M /trunk/Scribus/scribus/ui/transparencypalette.h
M /trunk/Scribus/scribus/canvas.cpp
M /trunk/Scribus/scribus/pageitem.cpp
M /trunk/Scribus/scribus/pdflib_core.h
M /trunk/Scribus/scribus/scpainter.h
M /trunk/Scribus/scribus/ui/propertiespalette.h
M /trunk/Scribus/scribus/scribus.h
M /trunk/Scribus/scribus/ui/transparencypalette.ui
M /trunk/Scribus/scribus/ui/transparencypalette.cpp
Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp (revision 14853)
+++ scribus/pdflib_core.cpp (revision 14854)
@@ -3245,7 +3245,7 @@
tmpData = inh;
inh = groupDataStack.pop();
if (Options.Version >= PDFOptions::PDFVersion_14 || Options.Version == PDFOptions::PDFVersion_X4)
- inh += Write_TransparencyGroup(controlItem->fillTransparency(), controlItem->fillBlendmode(), tmpData);
+ inh += Write_TransparencyGroup(controlItem->fillTransparency(), controlItem->fillBlendmode(), tmpData, controlItem);
else
inh += tmpData;
inh += "Q\n";
@@ -3255,7 +3255,7 @@
tmpData = Content;
Content = groupDataStack.pop();
if (Options.Version >= PDFOptions::PDFVersion_14 || Options.Version == PDFOptions::PDFVersion_X4)
- Content += Write_TransparencyGroup(controlItem->fillTransparency(), controlItem->fillBlendmode(), tmpData);
+ Content += Write_TransparencyGroup(controlItem->fillTransparency(), controlItem->fillBlendmode(), tmpData, controlItem);
else
Content += tmpData;
PutPage("Q\n");
@@ -3346,8 +3346,9 @@
return true;
}
-QString PDFLibCore::Write_TransparencyGroup(double trans, int blend, QString &data)
+QString PDFLibCore::Write_TransparencyGroup(double trans, int blend, QString &data, PageItem *controlItem)
{
+ QString ShName = "";
QString retString = "";
int Gobj = newObject();
StartObj(Gobj);
@@ -3356,12 +3357,22 @@
PutDoc("/I false\n");
PutDoc("/K false\n");
PutDoc(">>\nendobj\n");
- QString ShName = ResNam+QString::number(ResCount);
- ResCount++;
- Transpar[ShName] = writeGState("/CA "+FToStr(1.0 - trans)+"\n"
- + "/ca "+FToStr(1.0 - trans)+"\n"
- + "/SMask /None\n/AIS false\n/OPM 1\n"
- + "/BM /" + blendMode(blend) + "\n");
+ if (controlItem != NULL)
+ {
+ retString += "q\n";
+ retString = PDF_TransparenzFill(controlItem);
+ }
+ else
+ {
+ ShName = ResNam+QString::number(ResCount);
+ ResCount++;
+ Transpar[ShName] = writeGState("/CA "+FToStr(1.0 - trans)+"\n"
+ + "/ca "+FToStr(1.0 - trans)+"\n"
+ + "/SMask /None\n/AIS false\n/OPM 1\n"
+ + "/BM /" + blendMode(blend) + "\n");
+ retString += "q\n";
+ retString += "/"+ShName+" gs\n";
+ }
uint formObject = newObject();
StartObj(formObject);
PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1\n");
@@ -3381,8 +3392,6 @@
QString name = ResNam+QString::number(ResCount);
ResCount++;
Seite.XObjects[name] = formObject;
- retString += "q\n";
- retString += "/"+ShName+" gs\n";
retString += "/"+name+" Do\n";
retString += "Q\n";
return retString;
@@ -5800,6 +5809,8 @@
StopVec.clear();
TransVec.clear();
QTransform mpa;
+ if (currItem->isGroupControl)
+ mpa.translate(currItem->xPos() - ActPageP->xOffset(), ActPageP->height() - (currItem->yPos() - ActPageP->yOffset()));
mpa.rotate(-currItem->rotation());
if (Gskew == 90)
Gskew = 1;
@@ -5916,7 +5927,10 @@
PutDoc("/FormType 1\n");
PutDoc("/Group << /S /Transparency /CS /DeviceGray >>\n");
double lw = currItem->lineWidth();
- PutDoc("/BBox ["+FToStr(-lw / 2.0)+" "+FToStr(lw / 2.0)+" "+FToStr(currItem->width()+lw)+" "+FToStr(-(currItem->height()+lw))+" ]\n");
+ if (currItem->isGroupControl)
+ PutDoc("/BBox [0 0 "+FToStr(ActPageP->width())+" "+FToStr(ActPageP->height())+" ]\n");
+ else
+ PutDoc("/BBox ["+FToStr(-lw / 2.0)+" "+FToStr(lw / 2.0)+" "+FToStr(currItem->width()+lw)+" "+FToStr(-(currItem->height()+lw))+" ]\n");
PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
if (Patterns.count() != 0)
{
@@ -5927,7 +5941,10 @@
PutDoc(">>\n");
}
PutDoc(">>\n");
- QString stre = "q\n"+SetClipPath(currItem)+"h\n";
+ QString stre = "q\n";
+ if (currItem->isGroupControl)
+ stre += "1 0 0 1 "+ FToStr(currItem->xPos() - ActPageP->xOffset()) + " " + FToStr(ActPageP->height() - (currItem->yPos() - ActPageP->yOffset())) + " cm\n";
+ stre += SetClipPath(currItem)+"h\n";
stre += FToStr(fabs(currItem->lineWidth()))+" w\n";
stre += "/Pattern cs\n";
stre += "/Pattern"+QString::number(patObject)+" scn\nf*\n";
@@ -5969,7 +5986,10 @@
}
}
PutDoc(" >>\n");
- PutDoc("/BBox [0 0 "+FToStr(currItem->width())+" "+FToStr(-(currItem->height()))+" ]\n");
+ if (currItem->isGroupControl)
+ PutDoc("/BBox [0 0 "+FToStr(ActPageP->width())+" "+FToStr(ActPageP->height())+" ]\n");
+ else
+ PutDoc("/BBox [0 0 "+FToStr(currItem->width())+" "+FToStr(-(currItem->height()))+" ]\n");
PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
if (Patterns.count() != 0)
{
@@ -5980,7 +6000,10 @@
PutDoc(">>\n");
}
PutDoc(">>\n");
- QString stre = "q\n"+SetClipPath(currItem)+"h\n";
+ QString stre = "q\n";
+ if (currItem->isGroupControl)
+ stre += "1 0 0 1 "+ FToStr(currItem->xPos() - ActPageP->xOffset()) + " " + FToStr(ActPageP->height() - (currItem->yPos() - ActPageP->yOffset())) + " cm\n";
+ stre += SetClipPath(currItem)+"h\n";
stre += FToStr(fabs(currItem->lineWidth()))+" w\n";
stre += tmpOut+" f*\n";
stre += "Q\n";
@@ -6190,6 +6213,8 @@
}
else if (kind == 2)
{
+ if (currItem->isGroupControl)
+ mpa.translate(currItem->xPos() - ActPageP->xOffset(), ActPageP->height() - (currItem->yPos() - ActPageP->yOffset()));
currItem->maskTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
currItem->maskFlip(mirrorX, mirrorY);
}
Index: scribus/pdflib_core.h
===================================================================
--- scribus/pdflib_core.h (revision 14853)
+++ scribus/pdflib_core.h (revision 14854)
@@ -121,7 +121,7 @@
QString SetGradientColor(const QString& farbe, double Shade);
QString putColor(const QString& color, double Shade, bool fill);
QString putColorUncached(const QString& color, int Shade, bool fill);
- QString Write_TransparencyGroup(double trans, int blend, QString &data);
+ QString Write_TransparencyGroup(double trans, int blend, QString &data, PageItem *controlItem = 0);
QString setTextSt(PageItem *ite, uint PNr, const Page* pag);
bool setTextCh(PageItem *ite, uint PNr, double x, double y, uint d, QString &tmp, QString &tmp2, const ScText * hl, const ParagraphStyle& pstyle, const Page* pag);
void getBleeds(const Page* page, double &left, double &right);
Index: scribus/canvas.cpp
===================================================================
--- scribus/canvas.cpp (revision 14853)
+++ scribus/canvas.cpp (revision 14854)
@@ -1431,6 +1431,40 @@
if (currItem->isGroupControl)
{
painter->save();
+ QTransform mm;
+ mm.translate(currItem->xPos(), currItem->yPos());
+ mm.rotate(currItem->rotation());
+ if ((currItem->maskType() == 1) || (currItem->maskType() == 2) || (currItem->maskType() == 4) || (currItem->maskType() == 5))
+ {
+ if ((currItem->maskType() == 1) || (currItem->maskType() == 2))
+ painter->setMaskMode(1);
+ else
+ painter->setMaskMode(3);
+ if ((!currItem->gradientMask().isEmpty()) && (!m_doc->docGradients.contains(currItem->gradientMask())))
+ currItem->gradientMaskVal = "";
+ if (!(currItem->gradientMask().isEmpty()) && (m_doc->docGradients.contains(currItem->gradientMask())))
+ currItem->mask_gradient = m_doc->docGradients[currItem->gradientMask()];
+ painter->mask_gradient = currItem->mask_gradient;
+ if ((currItem->maskType() == 1) || (currItem->maskType() == 4))
+ painter->setGradientMask(VGradient::linear, FPoint(currItem->GrMaskStartX, currItem->GrMaskStartY).transformPoint(mm, false), FPoint(currItem->GrMaskEndX, currItem->GrMaskEndY).transformPoint(mm, false), FPoint(currItem->GrMaskStartX, currItem->GrMaskStartY).transformPoint(mm, false), currItem->GrMaskScale, currItem->GrMaskSkew);
+ else
+ painter->setGradientMask(VGradient::radial, FPoint(currItem->GrMaskStartX, currItem->GrMaskStartY).transformPoint(mm, false), FPoint(currItem->GrMaskEndX, currItem->GrMaskEndY).transformPoint(mm, false), FPoint(currItem->GrMaskFocalX, currItem->GrMaskFocalY).transformPoint(mm, false), currItem->GrMaskScale, currItem->GrMaskSkew);
+ }
+ else if ((currItem->maskType() == 3) || (currItem->maskType() == 6))
+ {
+ if ((currItem->patternMask().isEmpty()) || (!m_doc->docPatterns.contains(currItem->patternMask())))
+ painter->setMaskMode(0);
+ else
+ {
+ painter->setPatternMask(&m_doc->docPatterns[currItem->patternMask()], currItem->patternMaskScaleX, currItem->patternMaskScaleY, currItem->patternMaskOffsetX + currItem->xPos(), currItem->patternMaskOffsetY + currItem->yPos(), currItem->patternMaskRotation, currItem->patternMaskSkewX, currItem->patternMaskSkewY, currItem->patternMaskMirrorX, currItem->patternMaskMirrorY);
+ if (currItem->maskType() == 3)
+ painter->setMaskMode(2);
+ else
+ painter->setMaskMode(4);
+ }
+ }
+ else
+ painter->setMaskMode(0);
currItem->savedOwnPage = currItem->OwnPage;
currItem->OwnPage = page->pageNr();
if ((cullingArea.intersects(currItem->getBoundingRect().adjusted(0.0, 0.0, 1.0, 1.0))) && (m_doc->guidesSettings.layerMarkersShown) && (m_doc->layerCount() > 1))
@@ -1439,13 +1473,11 @@
currItem->DrawObj_Decoration(painter);
}
FPointArray cl = currItem->PoLine.copy();
- QTransform mm;
- mm.translate(currItem->xPos(), currItem->yPos());
- mm.rotate(currItem->rotation());
cl.map( mm );
painter->beginLayer(1.0 - currItem->fillTransparency(), currItem->fillBlendmode(), &cl);
groupStack.push(currItem->groupsLastItem);
groupStack2.push(currItem);
+ painter->setMaskMode(0);
currItem->OwnPage = currItem->savedOwnPage;
if (!currItem->ChangedMasterItem)
{
@@ -1625,14 +1657,46 @@
if (currItem->isGroupControl)
{
painter->save();
- FPointArray cl = currItem->PoLine.copy();
QTransform mm;
mm.translate(currItem->xPos(), currItem->yPos());
mm.rotate(currItem->rotation());
+ if ((currItem->maskType() == 1) || (currItem->maskType() == 2) || (currItem->maskType() == 4) || (currItem->maskType() == 5))
+ {
+ if ((currItem->maskType() == 1) || (currItem->maskType() == 2))
+ painter->setMaskMode(1);
+ else
+ painter->setMaskMode(3);
+ if ((!currItem->gradientMask().isEmpty()) && (!m_doc->docGradients.contains(currItem->gradientMask())))
+ currItem->gradientMaskVal = "";
+ if (!(currItem->gradientMask().isEmpty()) && (m_doc->docGradients.contains(currItem->gradientMask())))
+ currItem->mask_gradient = m_doc->docGradients[currItem->gradientMask()];
+ painter->mask_gradient = currItem->mask_gradient;
+ if ((currItem->maskType() == 1) || (currItem->maskType() == 4))
+ painter->setGradientMask(VGradient::linear, FPoint(currItem->GrMaskStartX, currItem->GrMaskStartY).transformPoint(mm, false), FPoint(currItem->GrMaskEndX, currItem->GrMaskEndY).transformPoint(mm, false), FPoint(currItem->GrMaskStartX, currItem->GrMaskStartY).transformPoint(mm, false), currItem->GrMaskScale, currItem->GrMaskSkew);
+ else
+ painter->setGradientMask(VGradient::radial, FPoint(currItem->GrMaskStartX, currItem->GrMaskStartY).transformPoint(mm, false), FPoint(currItem->GrMaskEndX, currItem->GrMaskEndY).transformPoint(mm, false), FPoint(currItem->GrMaskFocalX, currItem->GrMaskFocalY).transformPoint(mm, false), currItem->GrMaskScale, currItem->GrMaskSkew);
+ }
+ else if ((currItem->maskType() == 3) || (currItem->maskType() == 6))
+ {
+ if ((currItem->patternMask().isEmpty()) || (!m_doc->docPatterns.contains(currItem->patternMask())))
+ painter->setMaskMode(0);
+ else
+ {
+ painter->setPatternMask(&m_doc->docPatterns[currItem->patternMask()], currItem->patternMaskScaleX, currItem->patternMaskScaleY, currItem->patternMaskOffsetX + currItem->xPos(), currItem->patternMaskOffsetY + currItem->yPos(), currItem->patternMaskRotation, currItem->patternMaskSkewX, currItem->patternMaskSkewY, currItem->patternMaskMirrorX, currItem->patternMaskMirrorY);
+ if (currItem->maskType() == 3)
+ painter->setMaskMode(2);
+ else
+ painter->setMaskMode(4);
+ }
+ }
+ else
+ painter->setMaskMode(0);
+ FPointArray cl = currItem->PoLine.copy();
cl.map( mm );
painter->beginLayer(1.0 - currItem->fillTransparency(), currItem->fillBlendmode(), &cl);
groupStack.push(currItem->groupsLastItem);
groupStack2.push(currItem);
+ painter->setMaskMode(0);
continue;
}
if (cullingArea.intersects(currItem->getBoundingRect().adjusted(0.0, 0.0, 1.0, 1.0)))
Index: scribus/scpainter.cpp
===================================================================
--- scribus/scpainter.cpp (revision 14853)
+++ scribus/scpainter.cpp (revision 14854)
@@ -170,6 +170,20 @@
m_blendMode = blendmode;
la.pushed = false;
la.groupClip.resize(0);
+ la.maskMode = maskMode;
+ la.mask_patternScaleX = mask_patternScaleX;
+ la.mask_patternScaleY = mask_patternScaleY;
+ la.mask_patternOffsetX = mask_patternOffsetX;
+ la.mask_patternOffsetY = mask_patternOffsetY;
+ la.mask_patternRotation = mask_patternRotation;
+ la.mask_patternSkewX = mask_patternSkewX;
+ la.mask_patternSkewY = mask_patternSkewY;
+ la.mask_patternMirrorX = mask_patternMirrorX;
+ la.mask_patternMirrorY = mask_patternMirrorY;
+ la.mask_gradientScale = mask_gradientScale;
+ la.mask_gradientSkew = mask_gradientSkew;
+ la.mask_gradient = mask_gradient;
+ la.maskPattern = m_maskPattern;
if (clipArray != NULL)
la.groupClip = *clipArray;
#ifdef HAVE_CAIRO
@@ -196,6 +210,20 @@
if (Layers.count() == 0)
return;
la = Layers.pop();
+ maskMode = la.maskMode;
+ mask_patternScaleX = la.mask_patternScaleX;
+ mask_patternScaleY = la.mask_patternScaleY;
+ mask_patternOffsetX = la.mask_patternOffsetX;
+ mask_patternOffsetY = la.mask_patternOffsetY;
+ mask_patternRotation = la.mask_patternRotation;
+ mask_patternSkewX = la.mask_patternSkewX;
+ mask_patternSkewY = la.mask_patternSkewY;
+ mask_patternMirrorX = la.mask_patternMirrorX;
+ mask_patternMirrorY = la.mask_patternMirrorY;
+ mask_gradientScale = la.mask_gradientScale;
+ mask_gradientSkew = la.mask_gradientSkew;
+ mask_gradient = la.mask_gradient;
+ m_maskPattern = la.maskPattern;
if (la.pushed)
{
cairo_pop_group_to_source (m_cr);
@@ -223,6 +251,7 @@
}
m_layerTransparency = la.tranparency;
m_blendMode = la.blendmode;
+ maskMode = 0;
}
#else
void ScPainter::endLayer()
@@ -231,6 +260,20 @@
if (Layers.count() == 0)
return;
la = Layers.top();
+ maskMode = la.maskMode;
+ mask_patternScaleX = la.mask_patternScaleX;
+ mask_patternScaleY = la.mask_patternScaleY;
+ mask_patternOffsetX = la.mask_patternOffsetX;
+ mask_patternOffsetY = la.mask_patternOffsetY;
+ mask_patternRotation = la.mask_patternRotation;
+ mask_patternSkewX = la.mask_patternSkewX;
+ mask_patternSkewY = la.mask_patternSkewY;
+ mask_patternMirrorX = la.mask_patternMirrorX;
+ mask_patternMirrorY = la.mask_patternMirrorY;
+ mask_gradientScale = la.mask_gradientScale;
+ mask_gradientSkew = la.mask_gradientSkew;
+ mask_gradient = la.mask_gradient;
+ m_maskPattern = la.maskPattern;
if (la.pushed)
{
if ((m_blendMode != 0) && (Layers.count() != 0))
@@ -462,6 +505,7 @@
}
m_layerTransparency = la.tranparency;
m_blendMode = la.blendmode;
+ maskMode = 0;
}
#endif
#else
@@ -471,6 +515,20 @@
if (Layers.count() == 0)
return;
la = Layers.top();
+ maskMode = la.maskMode;
+ mask_patternScaleX = la.mask_patternScaleX;
+ mask_patternScaleY = la.mask_patternScaleY;
+ mask_patternOffsetX = la.mask_patternOffsetX;
+ mask_patternOffsetY = la.mask_patternOffsetY;
+ mask_patternRotation = la.mask_patternRotation;
+ mask_patternSkewX = la.mask_patternSkewX;
+ mask_patternSkewY = la.mask_patternSkewY;
+ mask_patternMirrorX = la.mask_patternMirrorX;
+ mask_patternMirrorY = la.mask_patternMirrorY;
+ mask_gradientScale = la.mask_gradientScale;
+ mask_gradientSkew = la.mask_gradientSkew;
+ mask_gradient = la.mask_gradient;
+ m_maskPattern = la.maskPattern;
if (la.pushed)
{
if ((m_blendMode > 11) && (Layers.count() != 0))
@@ -724,6 +782,7 @@
}
m_layerTransparency = la.tranparency;
m_blendMode = la.blendmode;
+ maskMode = 0;
}
#endif
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (revision 14853)
+++ scribus/pageitem.cpp (revision 14854)
@@ -1652,13 +1652,44 @@
if (embedded->isGroupControl)
{
p->save();
- FPointArray cl = embedded->PoLine.copy();
QTransform mm;
mm.translate((embedded->gXpos * (style.scaleH() / 1000.0)), ( - (embedded->gHeight * (style.scaleV() / 1000.0)) + embedded->gYpos * (style.scaleV() / 1000.0)));
if (style.baselineOffset() != 0)
mm.translate(0, -embedded->gHeight * (style.baselineOffset() / 1000.0));
mm.scale(style.scaleH() / 1000.0, style.scaleV() / 1000.0);
mm.rotate(embedded->rotation());
+ if ((embedded->GrMask == 1) || (embedded->GrMask == 2) || (embedded->GrMask == 4) || (embedded->GrMask == 5))
+ {
+ if ((embedded->GrMask == 1) || (embedded->GrMask == 2))
+ p->setMaskMode(1);
+ else
+ p->setMaskMode(3);
+ if ((!embedded->gradientMaskVal.isEmpty()) && (!m_Doc->docGradients.contains(embedded->gradientMaskVal)))
+ embedded->gradientMaskVal = "";
+ if (!(embedded->gradientMaskVal.isEmpty()) && (m_Doc->docGradients.contains(embedded->gradientMaskVal)))
+ embedded->mask_gradient = m_Doc->docGradients[embedded->gradientMaskVal];
+ p->mask_gradient = embedded->mask_gradient;
+ if ((embedded->GrMask == 1) || (embedded->GrMask == 4))
+ p->setGradientMask(VGradient::linear, FPoint(embedded->GrMaskStartX, embedded->GrMaskStartY).transformPoint(mm, false), FPoint(embedded->GrMaskEndX, embedded->GrMaskEndY).transformPoint(mm, false), FPoint(embedded->GrMaskStartX, embedded->GrMaskStartY).transformPoint(mm, false), embedded->GrMaskScale, embedded->GrMaskSkew);
+ else
+ p->setGradientMask(VGradient::radial, FPoint(embedded->GrMaskStartX, embedded->GrMaskStartY).transformPoint(mm, false), FPoint(embedded->GrMaskEndX, embedded->GrMaskEndY).transformPoint(mm, false), FPoint(embedded->GrMaskFocalX, embedded->GrMaskFocalY).transformPoint(mm, false), embedded->GrMaskScale, embedded->GrMaskSkew);
+ }
+ else if ((embedded->GrMask == 3) || (embedded->GrMask == 6))
+ {
+ if ((embedded->patternMaskVal.isEmpty()) || (!m_Doc->docPatterns.contains(embedded->patternMaskVal)))
+ p->setMaskMode(0);
+ else
+ {
+ p->setPatternMask(&m_Doc->docPatterns[embedded->patternMask()], embedded->patternMaskScaleX, embedded->patternMaskScaleY, embedded->patternMaskOffsetX + embedded->xPos(), embedded->patternMaskOffsetY + embedded->yPos(), embedded->patternMaskRotation, embedded->patternMaskSkewX, embedded->patternMaskSkewY, embedded->patternMaskMirrorX, embedded->patternMaskMirrorY);
+ if (embedded->GrMask == 3)
+ p->setMaskMode(2);
+ else
+ p->setMaskMode(4);
+ }
+ }
+ else
+ p->setMaskMode(0);
+ FPointArray cl = embedded->PoLine.copy();
cl.map( mm );
p->beginLayer(1.0 - embedded->fillTransparency(), embedded->fillBlendmode(), &cl);
groupStack.push(embedded->groupsLastItem);
@@ -1986,10 +2017,41 @@
if (embedded->isGroupControl)
{
painter->save();
- FPointArray cl = embedded->PoLine.copy();
QTransform mm;
mm.translate(embedded->gXpos, embedded->gYpos);
mm.rotate(embedded->rotation());
+ if ((embedded->GrMask == 1) || (embedded->GrMask == 2) || (embedded->GrMask == 4) || (embedded->GrMask == 5))
+ {
+ if ((embedded->GrMask == 1) || (embedded->GrMask == 2))
+ painter->setMaskMode(1);
+ else
+ painter->setMaskMode(3);
+ if ((!embedded->gradientMaskVal.isEmpty()) && (!m_Doc->docGradients.contains(embedded->gradientMaskVal)))
+ embedded->gradientMaskVal = "";
+ if (!(embedded->gradientMaskVal.isEmpty()) && (m_Doc->docGradients.contains(embedded->gradientMaskVal)))
+ embedded->mask_gradient = m_Doc->docGradients[embedded->gradientMaskVal];
+ painter->mask_gradient = embedded->mask_gradient;
+ if ((embedded->GrMask == 1) || (embedded->GrMask == 4))
+ painter->setGradientMask(VGradient::linear, FPoint(embedded->GrMaskStartX, embedded->GrMaskStartY).transformPoint(mm, false), FPoint(embedded->GrMaskEndX, embedded->GrMaskEndY).transformPoint(mm, false), FPoint(embedded->GrMaskStartX, embedded->GrMaskStartY).transformPoint(mm, false), embedded->GrMaskScale, embedded->GrMaskSkew);
+ else
+ painter->setGradientMask(VGradient::radial, FPoint(embedded->GrMaskStartX, embedded->GrMaskStartY).transformPoint(mm, false), FPoint(embedded->GrMaskEndX, embedded->GrMaskEndY).transformPoint(mm, false), FPoint(embedded->GrMaskFocalX, embedded->GrMaskFocalY).transformPoint(mm, false), embedded->GrMaskScale, embedded->GrMaskSkew);
+ }
+ else if ((embedded->GrMask == 3) || (embedded->GrMask == 6))
+ {
+ if ((embedded->patternMaskVal.isEmpty()) || (!m_Doc->docPatterns.contains(embedded->patternMaskVal)))
+ painter->setMaskMode(0);
+ else
+ {
+ painter->setPatternMask(&m_Doc->docPatterns[embedded->patternMask()], embedded->patternMaskScaleX, embedded->patternMaskScaleY, embedded->patternMaskOffsetX + embedded->xPos(), embedded->patternMaskOffsetY + embedded->yPos(), embedded->patternMaskRotation, embedded->patternMaskSkewX, embedded->patternMaskSkewY, embedded->patternMaskMirrorX, embedded->patternMaskMirrorY);
+ if (embedded->GrMask == 3)
+ painter->setMaskMode(2);
+ else
+ painter->setMaskMode(4);
+ }
+ }
+ else
+ painter->setMaskMode(0);
+ FPointArray cl = embedded->PoLine.copy();
cl.map( mm );
painter->beginLayer(1.0 - embedded->fillTransparency(), embedded->fillBlendmode(), &cl);
groupStack.push(embedded->groupsLastItem);
Index: scribus/ui/transparencypalette.ui
===================================================================
--- scribus/ui/transparencypalette.ui (revision 14853)
+++ scribus/ui/transparencypalette.ui (revision 14854)
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>236</width>
- <height>357</height>
+ <height>363</height>
</rect>
</property>
<property name="windowTitle">
@@ -62,7 +62,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
- <height>20</height>
+ <height>2</height>
</size>
</property>
</spacer>
Index: scribus/ui/transparencypalette.h
===================================================================
--- scribus/ui/transparencypalette.h (revision 14853)
+++ scribus/ui/transparencypalette.h (revision 14854)
@@ -62,6 +62,7 @@
void setDocument(ScribusDoc* doc);
void setCurrentItem(PageItem* item);
+ void hideSelectionButtons();
void updateFromItem();
public slots:
Index: scribus/ui/propertiespalette.h
===================================================================
--- scribus/ui/propertiespalette.h (revision 14853)
+++ scribus/ui/propertiespalette.h (revision 14854)
@@ -142,6 +142,7 @@
const VGradient getFillGradient();
const VGradient getStrokeGradient();
const VGradient getMaskGradient();
+ const VGradient getMaskGradientGroup();
void updateColorList();
void setGradientEditMode(bool);
void updateCmsList();
@@ -160,6 +161,7 @@
Cpalette *Cpal;
Tpalette *Tpal;
+ Tpalette *TpalGroup;
Autoforms* SCustom;
Autoforms* SCustom2;
ParaStyleComboBox *paraStyleCombo;
@@ -296,6 +298,7 @@
void toggleGradientEdit(int);
void NewSpGradientM(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk);
void toggleGradientEditM();
+ void toggleGradientEditMGroup();
void DoRevert();
void doClearCStyle();
void doClearPStyle();
@@ -322,8 +325,11 @@
void HandleTLines();
void setStartArrow(int id);
void setEndArrow(int id);
- void setGroupTransparency(int trans);
+ void setGroupTransparency(double trans);
void setGroupBlending(int blend);
+ void setGroupGradMask(int typ);
+ void setGroupPatternMask(QString pattern);
+ void setGroupPatternMaskProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
void doGrouping();
void dashChange();
void flop(int);
@@ -393,7 +399,7 @@
QHBoxLayout* layout24;
QVBoxLayout* page_group_layout;
QHBoxLayout* ShapeGroupLayout2;
- QGridLayout* Layout1t;
+ QVBoxLayout* Layout1t;
QHBoxLayout* wordTrackingHLayout;
QHBoxLayout* glyphExtensionHLayout;
QGridLayout* flopLayout;
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp (revision 14853)
+++ scribus/ui/propertiespalette.cpp (revision 14854)
@@ -672,24 +672,29 @@
textFlowOptionsB2->addButton(textFlowUsesContourLine2, 3);
textFlowOptionsB2->addButton(textFlowUsesImageClipping2, 4);
- TransGroup = new QGroupBox( tr( "Transparency Settings" ), page_group );
- Layout1t = new QGridLayout( TransGroup );
- Layout1t->setAlignment( Qt::AlignTop );
- Layout1t->setSpacing( 5 );
- Layout1t->setMargin( 5 );
- TransTxt = new QLabel( TransGroup );
- Layout1t->addWidget( TransTxt, 0, 0 );
- TransSpin = new QSpinBox( TransGroup );
- TransSpin->setMinimum(0);
- TransSpin->setMaximum(100);
- TransSpin->setSingleStep(10);
- TransSpin->setValue(100);
- Layout1t->addWidget(TransSpin, 0, 1);
- TransTxt2 = new QLabel( TransGroup );
- Layout1t->addWidget( TransTxt2, 1, 0 );
- blendMode = new ScComboBox( TransGroup );
- Layout1t->addWidget( blendMode, 1, 1 );
- page_group_layout->addWidget(TransGroup);
+// TransGroup = new QGroupBox( tr( "Transparency Settings" ), page_group );
+// Layout1t = new QVBoxLayout( TransGroup );
+// Layout1t->setAlignment( Qt::AlignTop );
+// Layout1t->setSpacing( 5 );
+// Layout1t->setMargin( 5 );
+
+ TpalGroup = new Tpalette(page_group);
+ TpalGroup->hideSelectionButtons();
+ page_group_layout->addWidget( TpalGroup );
+
+// TransTxt = new QLabel( TransGroup );
+// Layout1t->addWidget( TransTxt, 0, 0 );
+// TransSpin = new QSpinBox( TransGroup );
+// TransSpin->setMinimum(0);
+// TransSpin->setMaximum(100);
+// TransSpin->setSingleStep(10);
+// TransSpin->setValue(100);
+// Layout1t->addWidget(TransSpin, 0, 1);
+// TransTxt2 = new QLabel( TransGroup );
+// Layout1t->addWidget( TransTxt2, 1, 0 );
+// blendMode = new ScComboBox( TransGroup );
+// Layout1t->addWidget( blendMode, 1, 1 );
+// page_group_layout->addWidget(TransGroup);
QSpacerItem* spacerTr2 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
page_group_layout->addItem( spacerTr2 );
idGroupItem = TabStack->addItem(page_group, "Groups");
@@ -1610,14 +1615,16 @@
connect( Cpal, SIGNAL(editGradient(int)), this, SLOT(toggleGradientEdit(int)));
connect( Tpal, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double)), this, SLOT(NewSpGradientM(double, double, double, double, double, double, double, double )));
connect( Tpal, SIGNAL(editGradient()), this, SLOT(toggleGradientEditM()));
+ connect( TpalGroup, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double)), this, SLOT(NewSpGradientM(double, double, double, double, double, double, double, double )));
+ connect( TpalGroup, SIGNAL(editGradient()), this, SLOT(toggleGradientEditMGroup()));
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
// connect(lineSpacingPop, SIGNAL(triggered(QAction *)), this, SLOT(setLspMode(QAction *)));
connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setLineSpacingMode(int)));
connect( EvenOdd, SIGNAL( clicked() ), this, SLOT(handleFillRule() ) );
connect( NonZero, SIGNAL( clicked() ), this, SLOT( handleFillRule() ) );
- connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
- connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
+// connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
+// connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
connect(DoGroup, SIGNAL(clicked()), this, SLOT(doGrouping()) );
// connect(optMarginCombo, SIGNAL(activated(int)), this, SLOT(setOpticalMargins(int)) );
// connect(optMarginCheckLeftProtruding, SIGNAL(stateChanged(int)), this, SLOT(setOpticalMargins(int)) );
@@ -1690,6 +1697,7 @@
connect(this->Cpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
connect(this->Cpal, SIGNAL(strokeGradientChanged()), m_ScMW, SLOT(updtGradStroke()));
connect(this->Tpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradMask()));
+ connect(this->TpalGroup, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradMaskGroup()));
connect(DoUnGroup, SIGNAL(clicked()), m_ScMW, SLOT(UnGroupObj()) );
}
@@ -1912,6 +1920,12 @@
disconnect(this->Tpal, SIGNAL(NewPattern(QString)), 0, 0);
disconnect(this->Tpal, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), 0, 0);
+ disconnect(this->TpalGroup, SIGNAL(NewTrans(double)), 0, 0);
+ disconnect(this->TpalGroup, SIGNAL(NewBlend(int)), 0, 0);
+ disconnect(this->TpalGroup, SIGNAL(NewGradient(int)), 0, 0);
+ disconnect(this->TpalGroup, SIGNAL(NewPattern(QString)), 0, 0);
+ disconnect(this->TpalGroup, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), 0, 0);
+
disconnect(this->Cpal, SIGNAL(NewPen(QString)), 0, 0);
disconnect(this->Cpal, SIGNAL(NewBrush(QString)), 0, 0);
disconnect(this->Cpal, SIGNAL(NewPenShade(int)), 0, 0);
@@ -1931,6 +1945,8 @@
Cpal->setCurrentItem(NULL);
Tpal->setDocument(doc);
Tpal->setCurrentItem(NULL);
+ TpalGroup->setDocument(doc);
+ TpalGroup->setCurrentItem(NULL);
m_unitRatio=doc->unitRatio();
m_unitIndex=doc->unitIndex();
int precision = unitGetPrecisionFromIndex(m_unitIndex);
@@ -1997,6 +2013,13 @@
connect(this->Tpal, SIGNAL(NewPattern(QString)), doc, SLOT(itemSelection_SetItemPatternMask(QString)));
connect(this->Tpal, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemPatternMaskProps(double, double, double, double, double, double, double, bool, bool)));
+
+ connect(this->TpalGroup, SIGNAL(NewTrans(double)), this, SLOT(setGroupTransparency(double)));
+ connect(this->TpalGroup, SIGNAL(NewBlend(int)), this, SLOT(setGroupBlending(int)));
+ connect(this->TpalGroup, SIGNAL(NewGradient(int)), this, SLOT(setGroupGradMask(int)));
+ connect(this->TpalGroup, SIGNAL(NewPattern(QString)), this, SLOT(setGroupPatternMask(QString)));
+ connect(this->TpalGroup, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), this, SLOT(setGroupPatternMaskProps(double, double, double, double, double, double, double, bool, bool)));
+
connect(this->Cpal, SIGNAL(NewPen(QString)), doc, SLOT(itemSelection_SetItemPen(QString)));
connect(this->Cpal, SIGNAL(NewBrush(QString)), doc, SLOT(itemSelection_SetItemBrush(QString)));
connect(this->Cpal, SIGNAL(NewPenShade(int)), doc, SLOT(itemSelection_SetItemPenShade(int)));
@@ -2021,6 +2044,8 @@
Cpal->setDocument(NULL);
Tpal->setCurrentItem(NULL);
Tpal->setDocument(NULL);
+ TpalGroup->setDocument(NULL);
+ TpalGroup->setCurrentItem(NULL);
Xpos->setConstants(NULL);
Ypos->setConstants(NULL);
Width->setConstants(NULL);
@@ -2059,6 +2084,7 @@
CurItem = NULL;
Cpal->setCurrentItem(NULL);
Tpal->setCurrentItem(NULL);
+ TpalGroup->setCurrentItem(NULL);
dashEditor->hide();
NewSel(-1);
}
@@ -2133,6 +2159,7 @@
Cpal->updateFromItem();
Tpal->setCurrentItem(CurItem);
Tpal->updateFromItem();
+ TpalGroup->setCurrentItem(CurItem);
/* if (TabStack->currentIndex() == idColorsItem)
Cpal->setActGradient(CurItem->GrType);
updateColorSpecialGradient();
@@ -2345,8 +2372,8 @@
TabStack3->setCurrentIndex(0);
}
LayerGroup->setEnabled(!setter);
- disconnect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
- disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
+// disconnect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
+// disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
if ((CurItem->isGroupControl) || ((CurItem->Groups.count() != 0) && (!CurItem->isSingleSel)))
{
TabStack->setItemEnabled(idXYZItem, true);
@@ -2362,10 +2389,12 @@
SCustom2->setIcon(SCustom2->getIconPixmap(1));
if (CurItem->FrameType > 3)
SCustom2->setIcon(SCustom2->getIconPixmap(CurItem->FrameType-2));
- TransSpin->setValue(qRound(100 - (CurItem->fillTransparency() * 100)));
- blendMode->setCurrentIndex(CurItem->fillBlendmode());
- TransSpin->setEnabled(true);
- blendMode->setEnabled(true);
+ TpalGroup->updateFromItem();
+ TpalGroup->setActPattern(i->patternMask(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);
+ // TransSpin->setValue(qRound(100 - (CurItem->fillTransparency() * 100)));
+ // blendMode->setCurrentIndex(CurItem->fillBlendmode());
+ // TransSpin->setEnabled(true);
+ // blendMode->setEnabled(true);
SCustom2->setEnabled(true);
EditShape2->setEnabled(true);
SRect2->setEnabled(true);
@@ -2377,8 +2406,8 @@
}
else
TabStack->setItemEnabled(idGroupItem, false);
- connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
- connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
+// connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
+// connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
/*
Xpos->setReadOnly(setter);
Ypos->setReadOnly(setter);
@@ -2855,6 +2884,7 @@
LSize->setNewUnit( m_unitIndex );
Cpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
Tpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
+ TpalGroup->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
HaveItem = tmp;
}
@@ -4817,6 +4847,20 @@
}
}
+void PropertiesPalette::toggleGradientEditMGroup()
+{
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
+ return;
+ if ((HaveDoc) && (HaveItem))
+ {
+ m_ScMW->view->editStrokeGradient = 2;
+ if (TpalGroup->gradEditButton->isChecked())
+ m_ScMW->view->requestMode(modeEditGradientVectors);
+ else
+ m_ScMW->view->requestMode(modeNormal);
+ }
+}
+
void PropertiesPalette::NewTFont(QString c)
{
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
@@ -4903,6 +4947,9 @@
Tpal->SetColors(doc->PageColors);
Tpal->SetPatterns(&doc->docPatterns);
Tpal->SetGradients(&doc->docGradients);
+ TpalGroup->SetColors(doc->PageColors);
+ TpalGroup->SetPatterns(&doc->docPatterns);
+ TpalGroup->SetGradients(&doc->docGradients);
assert (doc->PageColors.document());
TxFill->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
TxStroke->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, false);
@@ -5376,27 +5423,27 @@
EditShape->setText( tr("&Edit..."));
EditShape2->setText( tr("&Edit..."));
SRect2->setText( tr("Shape:"));
- TransGroup->setTitle( tr( "Transparency Settings" ));
- TransTxt->setText( tr( "Opacity:" ) );
- TransTxt2->setText( tr( "Blend Mode:" ) );
- int oldBlendMode = blendMode->currentIndex();
- 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->setCurrentIndex(oldBlendMode);
+// TransGroup->setTitle( tr( "Transparency Settings" ));
+// TransTxt->setText( tr( "Opacity:" ) );
+// TransTxt2->setText( tr( "Blend Mode:" ) );
+// int oldBlendMode = blendMode->currentIndex();
+// 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->setCurrentIndex(oldBlendMode);
rndcornersLabel->setText( tr("R&ound\nCorners:"));
columnsLabel->setText( tr("Colu&mns:"));
int oldcolgapLabel = colgapLabel->currentIndex();
@@ -5735,6 +5782,11 @@
return Tpal->gradEdit->gradient();
}
+const VGradient PropertiesPalette::getMaskGradientGroup()
+{
+ return TpalGroup->gradEdit->gradient();
+}
+
void PropertiesPalette::setGradientEditMode(bool on)
{
Cpal->gradEditButton->setChecked(on);
@@ -5755,7 +5807,12 @@
else if (m_ScMW->view->editStrokeGradient == 1)
Cpal->setSpecialGradient(currItem->GrStrokeStartX * dur, currItem->GrStrokeStartY * dur, currItem->GrStrokeEndX * dur, currItem->GrStrokeEndY * dur, currItem->GrStrokeFocalX * dur, currItem->GrStrokeFocalY * dur, currItem->GrStrokeScale, currItem->GrStrokeSkew);
else
- Tpal->setSpecialGradient(currItem->GrMaskStartX * dur, currItem->GrMaskStartY * dur, currItem->GrMaskEndX * dur, currItem->GrMaskEndY * dur, currItem->GrMaskFocalX * dur, currItem->GrMaskFocalY * dur, currItem->GrMaskScale, currItem->GrMaskSkew);
+ {
+ if (currItem->isGroupControl)
+ TpalGroup->setSpecialGradient(currItem->GrMaskStartX * dur, currItem->GrMaskStartY * dur, currItem->GrMaskEndX * dur, currItem->GrMaskEndY * dur, currItem->GrMaskFocalX * dur, currItem->GrMaskFocalY * dur, currItem->GrMaskScale, currItem->GrMaskSkew);
+ else
+ Tpal->setSpecialGradient(currItem->GrMaskStartX * dur, currItem->GrMaskStartY * dur, currItem->GrMaskEndX * dur, currItem->GrMaskEndY * dur, currItem->GrMaskFocalX * dur, currItem->GrMaskFocalY * dur, currItem->GrMaskScale, currItem->GrMaskSkew);
+ }
}
}
@@ -5860,11 +5917,11 @@
FlipV->setChecked(isFlippedV);
}
-void PropertiesPalette::setGroupTransparency(int trans)
+void PropertiesPalette::setGroupTransparency(double trans)
{
if ((HaveDoc) && (HaveItem))
{
- CurItem->setFillTransparency(static_cast<double>(100 - trans) / 100.0);
+ CurItem->setFillTransparency(trans);
CurItem->update();
emit DocChanged();
}
@@ -5872,11 +5929,47 @@
void PropertiesPalette::setGroupBlending(int blend)
{
+ if ((HaveDoc) && (HaveItem))
+ {
CurItem->setFillBlendmode(blend);
CurItem->update();
emit DocChanged();
+ }
}
+void PropertiesPalette::setGroupGradMask(int typ)
+{
+ if ((HaveDoc) && (HaveItem))
+ {
+ CurItem->GrMask = typ;
+ if ((typ > 0) && (typ < 7))
+ CurItem->updateGradientVectors();
+ CurItem->update();
+ emit DocChanged();
+ }
+}
+
+void PropertiesPalette::setGroupPatternMask(QString pattern)
+{
+ if ((HaveDoc) && (HaveItem))
+ {
+ CurItem->setPatternMask(pattern);
+ CurItem->update();
+ emit DocChanged();
+ }
+}
+
+void PropertiesPalette::setGroupPatternMaskProps(double imageScaleX, double imageScaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY)
+{
+ if ((HaveDoc) && (HaveItem))
+ {
+ CurItem->setMaskTransform(imageScaleX, imageScaleY, offsetX, offsetY, rotation, skewX, skewY);
+ CurItem->setMaskFlip(mirrorX, mirrorY);
+ CurItem->update();
+ emit DocChanged();
+ }
+}
+
void PropertiesPalette::doGrouping()
{
m_ScMW->GroupObj();
Index: scribus/ui/transparencypalette.cpp
===================================================================
--- scribus/ui/transparencypalette.cpp (revision 14853)
+++ scribus/ui/transparencypalette.cpp (revision 14854)
@@ -75,6 +75,14 @@
}
}
+void Tpalette::hideSelectionButtons()
+{
+ editLineSelector->hide();
+ editLineSelector->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored));
+ editFillSelector->hide();
+ editFillSelector->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored));
+}
+
void Tpalette::updateFromItem()
{
if (currentItem == NULL)
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp (revision 14853)
+++ scribus/scribus.cpp (revision 14854)
@@ -7306,6 +7306,14 @@
VGradient vg(propertiesPalette->getMaskGradient());
doc->itemSelection_SetMaskGradient(vg);
}
+
+void ScribusMainWindow::updtGradMaskGroup()
+{
+ if (!HaveDoc)
+ return;
+ VGradient vg(propertiesPalette->getMaskGradientGroup());
+ doc->itemSelection_SetMaskGradient(vg);
+}
/*
//CB-->Doc
void ScribusMainWindow::GetBrushPen()
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h (revision 14853)
+++ scribus/scribus.h (revision 14854)
@@ -457,6 +457,7 @@
void updtGradFill();
void updtGradStroke();
void updtGradMask();
+ void updtGradMaskGroup();
/*
// Setzt die Pen-Farbe
void setPenFarbe(QString farbe);
Index: scribus/scpainter.h
===================================================================
--- scribus/scpainter.h (revision 14853)
+++ scribus/scpainter.h (revision 14854)
@@ -124,6 +124,20 @@
cairo_surface_t *data;
int blendmode;
double tranparency;
+ int maskMode; // 0 = none, 1 = gradient 2 = pattern
+ double mask_patternScaleX;
+ double mask_patternScaleY;
+ double mask_patternOffsetX;
+ double mask_patternOffsetY;
+ double mask_patternRotation;
+ double mask_patternSkewX;
+ double mask_patternSkewY;
+ bool mask_patternMirrorX;
+ bool mask_patternMirrorY;
+ double mask_gradientScale;
+ double mask_gradientSkew;
+ VGradient mask_gradient;
+ ScPattern *maskPattern;
FPointArray groupClip;
bool pushed;
};
@@ -138,6 +152,20 @@
QImage *data;
int blendmode;
double tranparency;
+ int maskMode; // 0 = none, 1 = gradient 2 = pattern
+ double mask_patternScaleX;
+ double mask_patternScaleY;
+ double mask_patternOffsetX;
+ double mask_patternOffsetY;
+ double mask_patternRotation;
+ double mask_patternSkewX;
+ double mask_patternSkewY;
+ bool mask_patternMirrorX;
+ bool mask_patternMirrorY;
+ double mask_gradientScale;
+ double mask_gradientSkew;
+ VGradient mask_gradient;
+ ScPattern *maskPattern;
FPointArray groupClip;
bool pushed;
};
More information about the scribus-commit
mailing list