r22987 by jghali - #15686: Text with background color is not printed correctly
scribus-commit
scribus-commit at lists.scribus.net
Mon May 20 23:36:18 UTC 2019
Author: jghali
Date: Mon May 20 23:36:18 2019
New Revision: 22987
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22987
Log:
#15686: Text with background color is not printed correctly
Modified:
trunk/Scribus/scribus/pdflib_core.cpp
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22987&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Mon May 20 23:36:18 2019
@@ -113,6 +113,7 @@
class PdfPainter: public TextLayoutPainter
{
+ QByteArray m_backBuffer;
QByteArray m_glyphBuffer;
QByteArray m_pathBuffer;
// PageItem* m_item;
@@ -131,6 +132,7 @@
public:
PdfPainter(PageItem *ite, PDFLibCore *pdf, uint num, const ScPage* pag) :
+ m_backBuffer(),
m_glyphBuffer(),
m_pathBuffer(),
// m_item(ite),
@@ -474,7 +476,7 @@
QByteArray getBuffer()
{
- return "BT\n" + m_glyphBuffer + "ET\n" + m_pathBuffer;
+ return m_backBuffer + "BT\n" + m_glyphBuffer + "ET\n" + m_pathBuffer;
}
void drawRect(QRectF rect)
@@ -483,17 +485,17 @@
// transform.translate(x(), y());
double rectX = x() + rect.x();
double rectY = -y() - rect.y();
- m_glyphBuffer += "q\n";
- m_glyphBuffer += transformToStr(transform) + " cm\n";
- m_glyphBuffer += "n\n";
- m_glyphBuffer += m_pdf->putColor(fillColor().color, fillColor().shade, true);
- m_glyphBuffer += m_pdf->putColor(strokeColor().color, strokeColor().shade, false);
- m_glyphBuffer += FToStr(rectX) + " " + FToStr(rectY) + " m\n";
- m_glyphBuffer += FToStr(rectX + rect.width()) + " " + FToStr(rectY) + " l\n";
- m_glyphBuffer += FToStr(rectX + rect.width()) + " " + FToStr(rectY - rect.height()) + " l\n";
- m_glyphBuffer += FToStr(rectX) + " " + FToStr(rectY - rect.height()) + " l\n";
- m_glyphBuffer += "h\nf\n";
- m_glyphBuffer += "Q\n";
+ m_backBuffer += "q\n";
+ m_backBuffer += transformToStr(transform) + " cm\n";
+ m_backBuffer += "n\n";
+ m_backBuffer += m_pdf->putColor(fillColor().color, fillColor().shade, true);
+ m_backBuffer += m_pdf->putColor(strokeColor().color, strokeColor().shade, false);
+ m_backBuffer += FToStr(rectX) + " " + FToStr(rectY) + " m\n";
+ m_backBuffer += FToStr(rectX + rect.width()) + " " + FToStr(rectY) + " l\n";
+ m_backBuffer += FToStr(rectX + rect.width()) + " " + FToStr(rectY - rect.height()) + " l\n";
+ m_backBuffer += FToStr(rectX) + " " + FToStr(rectY - rect.height()) + " l\n";
+ m_backBuffer += "h\nf\n";
+ m_backBuffer += "Q\n";
}
void drawObject(PageItem* embedded)
More information about the scribus-commit
mailing list