r18149 by fschmid - Fixed export of scaled Inline Frames in PDF and PS.
scribus-commit
scribus-commit at lists.scribus.net
Sun Feb 17 15:55:51 UTC 2013
Author: fschmid
Date: Sun Feb 17 15:55:51 2013
New Revision: 18149
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18149
Log:
Fixed export of scaled Inline Frames in PDF and PS.
Modified:
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/pslib.cpp
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18149&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sun Feb 17 15:55:51 2013
@@ -5190,20 +5190,31 @@
tmp += "ET\n"+tmp2;
tmp2 = "";
}
- QList<PageItem*> emG = hl->getGroupedItems(&doc);
- for (int em = 0; em < emG.count(); ++em)
- {
- PageItem* embedded = emG.at(em);
- tmp2 += "q\n";
- if (ite->asPathText())
- tmp2 += FToStr(style.scaleH() / 1000.0)+" 0 0 "+FToStr(style.scaleV() / 1000.0)+" "+FToStr(embedded->gXpos * (style.scaleH() / 1000.0))+" "+FToStr((embedded->height() * (style.scaleV() / 1000.0)) - embedded->gYpos * (style.scaleV() / 1000.0)+embedded->gHeight * (style.baselineOffset() / 1000.0))+" cm\n";
+ PageItem* embedded = hl->getItem(&doc);
+ tmp2 += "q\n";
+ if (ite->asPathText())
+ tmp2 += FToStr(style.scaleH() / 1000.0)+" 0 0 "+FToStr(style.scaleV() / 1000.0)+" "+FToStr(embedded->gXpos * (style.scaleH() / 1000.0))+" "+FToStr((embedded->height() * (style.scaleV() / 1000.0)) - embedded->gYpos * (style.scaleV() / 1000.0)+embedded->gHeight * (style.baselineOffset() / 1000.0))+" cm\n";
+ else
+ {
+ if (d == 0 || ite->itemText.text(d-1) == SpecialChars::PARSEP)
+ {
+ if ((style.baselineOffset() != 0) && (!pstyle.hasDropCap()))
+ tmp2 += FToStr(style.scaleH() / 1000.0)+" 0 0 "+FToStr(style.scaleV() / 1000.0)+" "+FToStr(x+hl->glyph.xoffset + embedded->gXpos * (style.scaleH() / 1000.0))+" "+FToStr(-y-hl->glyph.yoffset + (embedded->height() * (style.scaleV() / 1000.0)) - embedded->gYpos * (style.scaleV() / 1000.0)+embedded->height() * (style.baselineOffset() / 1000.0))+" cm\n";
+ else
+ tmp2 += FToStr(style.scaleH() / 1000.0)+" 0 0 "+FToStr(style.scaleV() / 1000.0)+" "+FToStr(x+hl->glyph.xoffset + embedded->gXpos * (style.scaleH() / 1000.0))+" "+FToStr(-y-hl->glyph.yoffset + (embedded->height() * (style.scaleV() / 1000.0)) - embedded->gYpos * (style.scaleV() / 1000.0))+" cm\n";
+ }
else
- tmp2 += FToStr(style.scaleH() / 1000.0)+" 0 0 "+FToStr(style.scaleV() / 1000.0)+" "+FToStr(x+hl->glyph.xoffset + embedded->gXpos * (style.scaleH() / 1000.0))+" "+FToStr(-y-hl->glyph.yoffset + (embedded->height() * (style.scaleV() / 1000.0)) - embedded->gYpos * (style.scaleV() / 1000.0)+embedded->height() * (style.baselineOffset() / 1000.0))+" cm\n";
- if (!PDF_ProcessItem(output, embedded, pag, PNr, true))
- return false;
- tmp2 +=output;
- tmp2 += "Q\n";
- }
+ {
+ if (style.baselineOffset() != 0)
+ tmp2 += FToStr(style.scaleH() / 1000.0)+" 0 0 "+FToStr(style.scaleV() / 1000.0)+" "+FToStr(x+hl->glyph.xoffset + embedded->gXpos * (style.scaleH() / 1000.0))+" "+FToStr(-y-hl->glyph.yoffset + (embedded->height() * (style.scaleV() / 1000.0)) - embedded->gYpos * (style.scaleV() / 1000.0)+embedded->height() * (style.baselineOffset() / 1000.0))+" cm\n";
+ else
+ tmp2 += FToStr(style.scaleH() / 1000.0)+" 0 0 "+FToStr(style.scaleV() / 1000.0)+" "+FToStr(x+hl->glyph.xoffset + embedded->gXpos * (style.scaleH() / 1000.0))+" "+FToStr(-y-hl->glyph.yoffset + (embedded->height() * (style.scaleV() / 1000.0)) - embedded->gYpos * (style.scaleV() / 1000.0))+" cm\n";
+ }
+ }
+ if (!PDF_ProcessItem(output, embedded, pag, PNr, true))
+ return false;
+ tmp2 +=output;
+ tmp2 += "Q\n";
tmp += tmp2+"\n";
tmp2 = "";
if (ite->asPathText())
Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18149&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Sun Feb 17 15:55:51 2013
@@ -5099,21 +5099,25 @@
*/
if (hl->hasObject(Doc))
{
- QList<PageItem*> emG = hl->getGroupedItems(Doc);
- for (int em = 0; em < emG.count(); ++em)
- {
- PageItem* embedded = emG.at(em);
- PS_save();
- PS_translate(x + hl->glyph.xoffset + embedded->gXpos * (cstyle.scaleH() / 1000.0), (y + hl->glyph.yoffset - (embedded->gHeight * (cstyle.scaleV() / 1000.0)) + embedded->gYpos * (cstyle.scaleV() / 1000.0)) * -1);
+ PageItem* embedded = hl->getItem(Doc);
+ PS_save();
+ PS_translate(x + hl->glyph.xoffset + embedded->gXpos * (cstyle.scaleH() / 1000.0), (y + hl->glyph.yoffset - (embedded->gHeight * (cstyle.scaleV() / 1000.0)) + embedded->gYpos * (cstyle.scaleV() / 1000.0)) * -1);
+ if (doh == 0 || ite->itemText.text(doh-1) == SpecialChars::PARSEP)
+ {
+ if ((cstyle.baselineOffset() != 0) && (!pstyle.hasDropCap()))
+ PS_translate(0, embedded->gHeight * (cstyle.baselineOffset() / 1000.0));
+ }
+ else
+ {
if (cstyle.baselineOffset() != 0)
PS_translate(0, embedded->gHeight * (cstyle.baselineOffset() / 1000.0));
- if (cstyle.scaleH() != 1000)
- PS_scale(cstyle.scaleH() / 1000.0, 1);
- if (cstyle.scaleV() != 1000)
- PS_scale(1, cstyle.scaleV() / 1000.0);
- ProcessItem(Doc, pg, embedded, argh, sep, farb, ic, gcr, master, true);
- PS_restore();
- }
+ }
+ if (cstyle.scaleH() != 1000)
+ PS_scale(cstyle.scaleH() / 1000.0, 1);
+ if (cstyle.scaleV() != 1000)
+ PS_scale(1, cstyle.scaleV() / 1000.0);
+ ProcessItem(Doc, pg, embedded, argh, sep, farb, ic, gcr, master, true);
+ PS_restore();
return;
}
More information about the scribus-commit
mailing list