r22746 by jghali - #15469: Scribus shows wrong style for PDF-Textfield style "Underline"

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 1 11:39:54 UTC 2018


Author: jghali
Date: Thu Nov  1 11:39:54 2018
New Revision: 22746

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22746
Log:
#15469: Scribus shows wrong style for PDF-Textfield style "Underline"

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/scpainter.h

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22746&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Thu Nov  1 11:39:54 2018
@@ -3257,7 +3257,9 @@
 					else
 						BStyle = 4;
 				}
-				if (BStyle == 3)
+				if (BStyle == 2)
+					p->drawUnderlinedRect(QRectF(0, 0, m_width, m_height), tmp, annotation().Bwid());
+				else if (BStyle == 3)
 					p->drawShadePanel(QRectF(0, 0, m_width, m_height), tmp, false, annotation().Bwid());
 				else if (BStyle == 4)
 					p->drawShadePanel(QRectF(0, 0, m_width, m_height), tmp, true, annotation().Bwid());

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22746&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp	(original)
+++ trunk/Scribus/scribus/scpainter.cpp	Thu Nov  1 11:39:54 2018
@@ -1861,6 +1861,18 @@
 	fillPath();
 }
 
+void ScPainter::drawUnderlinedRect(const QRectF &r, const QColor& color, int lineWidth)
+{
+	setPen(color, lineWidth, Qt::DashLine, Qt::FlatCap, Qt::MiterJoin);
+	setStrokeMode(ScPainter::Solid);
+	drawLine(r.bottomLeft(), r.topLeft());
+	drawLine(r.topLeft(), r.topRight());
+	drawLine(r.bottomRight(), r.topRight());
+
+	setPen(color, lineWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+	drawLine(r.bottomLeft(), r.bottomRight());
+}
+
 void ScPainter::colorizeAlpha(const QColor& color)
 {
 	cairo_surface_t *data = cairo_get_group_target(m_cr);

Modified: trunk/Scribus/scribus/scpainter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22746&path=/trunk/Scribus/scribus/scpainter.h
==============================================================================
--- trunk/Scribus/scribus/scpainter.h	(original)
+++ trunk/Scribus/scribus/scpainter.h	Thu Nov  1 11:39:54 2018
@@ -104,6 +104,7 @@
 	virtual void drawText(QRectF area, const QString& text, bool filled = true, int align = 0);
 	virtual void drawShadeCircle(const QRectF &re, const QColor& color, bool sunken, int lineWidth);
 	virtual void drawShadePanel(const QRectF &r, const QColor& color, bool sunken, int lineWidth);
+	virtual void drawUnderlinedRect(const QRectF &r, const QColor& color, int lineWidth);
 	virtual void colorizeAlpha(const QColor& color);
 	virtual void colorize(const QColor& color);
 	virtual void blurAlpha(int radius);




More information about the scribus-commit mailing list