r23411 by jghali - Simplify PageItem_Line::getVisualBoundingRect() code by using PageItem::visualLineWidth()

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 10 05:32:18 UTC 2019


Author: jghali
Date: Tue Dec 10 05:32:18 2019
New Revision: 23411

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23411
Log:
Simplify PageItem_Line::getVisualBoundingRect() code by using PageItem::visualLineWidth()

Modified:
    trunk/Scribus/scribus/pageitem_line.cpp

Modified: trunk/Scribus/scribus/pageitem_line.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23411&path=/trunk/Scribus/scribus/pageitem_line.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_line.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_line.cpp	Tue Dec 10 05:32:18 2019
@@ -276,37 +276,7 @@
 	double miny =  std::numeric_limits<double>::max();
 	double maxx = -std::numeric_limits<double>::max();
 	double maxy = -std::numeric_limits<double>::max();
-	double extraSpace = 0.0;
-	if (NamedLStyle.isEmpty())
-	{
-		if ((lineColor() != CommonStrings::None) || (!patternStrokeVal.isEmpty()) || (GrTypeStroke > 0))
-		{
-			extraSpace = m_lineWidth / 2.0;
-			if ((extraSpace == 0) && m_Doc->view()) // Hairline case
-				extraSpace = 0.5 / m_Doc->view()->scale();
-		}
-		if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)) && (patternStrokePath))
-		{
-			ScPattern *pat = &m_Doc->docPatterns[patternStrokeVal];
-			QTransform mat;
-			mat.rotate(patternStrokeRotation);
-			mat.scale(patternStrokeScaleX / 100.0, patternStrokeScaleY / 100.0);
-			QRectF p1R = QRectF(0, 0, pat->width / 2.0, pat->height / 2.0);
-			QRectF p2R = mat.map(p1R).boundingRect();
-			extraSpace = p2R.height();
-		}
-	}
-	else
-	{
-		multiLine ml = m_Doc->MLineStyles[NamedLStyle];
-		const SingleLine& sl = ml.last();
-		if (sl.Color != CommonStrings::None)
-		{
-			extraSpace = sl.Width / 2.0;
-			if ((extraSpace == 0) && m_Doc->view()) // Hairline case
-				extraSpace = 0.5 / m_Doc->view()->scale();
-		}
-	}
+	double extraSpace = visualLineWidth() / 2.0;
 	if (m_rotation != 0)
 	{
 		FPointArray pb;




More information about the scribus-commit mailing list