r22352 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Wed Jan 17 22:10:47 UTC 2018


Author: jghali
Date: Wed Jan 17 22:10:47 2018
New Revision: 22352

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22352
Log:
#15104: Lines sometimes reported by Preflight Verifier as "not on page"

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_line.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22352&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Wed Jan 17 22:10:47 2018
@@ -8978,7 +8978,11 @@
 			if (isLine() && (PLineEnd == Qt::FlatCap))
 				extraSpace = 0.0;
 			else
+			{
 				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))
 		{
@@ -8994,9 +8998,13 @@
 	else
 	{
 		multiLine ml = m_Doc->MLineStyles[NamedLStyle];
-		struct SingleLine& sl = ml[ml.size()-1];
-		if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
+		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();
+		}
 	}
 	if (m_rotation != 0)
 	{
@@ -9035,7 +9043,11 @@
 		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];
@@ -9050,9 +9062,13 @@
 		else
 		{
 			multiLine ml = m_Doc->MLineStyles[NamedLStyle];
-			struct SingleLine& sl = ml[ml.size()-1];
-			if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
+			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();
+			}
 		}
 	}
 	if (isPathText())
@@ -9066,7 +9082,11 @@
 	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];
@@ -9081,9 +9101,13 @@
 	else
 	{
 		multiLine ml = m_Doc->MLineStyles[NamedLStyle];
-		struct SingleLine& sl = ml[ml.size()-1];
-		if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
+		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();
+		}
 	}
 	if (isPathText())
 		return qMin(m_yPos + QRectF(Clip.boundingRect()).y(), m_yPos - extraSpace);
@@ -9098,7 +9122,11 @@
 		if (NamedLStyle.isEmpty())
 		{
 			if ((lineColor() != CommonStrings::None) || (!patternStrokeVal.isEmpty()) || (GrTypeStroke > 0))
+			{
 				extraSpace = m_lineWidth;
+				if ((extraSpace == 0) && m_Doc->view()) // Hairline case
+					extraSpace = 1.0 / m_Doc->view()->scale();
+			}
 			if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)) && (patternStrokePath))
 			{
 				ScPattern *pat = &m_Doc->docPatterns[patternStrokeVal];
@@ -9113,9 +9141,13 @@
 		else
 		{
 			multiLine ml = m_Doc->MLineStyles[NamedLStyle];
-			struct SingleLine& sl = ml[ml.size()-1];
-			if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
+			const SingleLine& sl = ml.last();
+			if (sl.Color != CommonStrings::None)
+			{
 				extraSpace = sl.Width;
+				if ((extraSpace == 0) && m_Doc->view()) // Hairline case
+					extraSpace = 1.0 / m_Doc->view()->scale();
+			}
 		}
 	}
 	if (isPathText())
@@ -9129,7 +9161,11 @@
 	if (NamedLStyle.isEmpty())
 	{
 		if ((lineColor() != CommonStrings::None) || (!patternStrokeVal.isEmpty()) || (GrTypeStroke > 0))
+		{
 			extraSpace = m_lineWidth;
+			if ((extraSpace == 0) && m_Doc->view()) // Hairline case
+				extraSpace = 1.0 / m_Doc->view()->scale();
+		}
 		if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)) && (patternStrokePath))
 		{
 			ScPattern *pat = &m_Doc->docPatterns[patternStrokeVal];
@@ -9145,8 +9181,12 @@
 	{
 		multiLine ml = m_Doc->MLineStyles[NamedLStyle];
 		struct SingleLine& sl = ml[ml.size()-1];
-		if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
+		if (sl.Color != CommonStrings::None)
+		{
 			extraSpace = sl.Width;
+			if ((extraSpace == 0) && m_Doc->view()) // Hairline case
+				extraSpace = 1.0 / m_Doc->view()->scale();
+		}
 	}
 	if (isPathText())
 		return qMax(QRectF(Clip.boundingRect()).height(), m_height + extraSpace);
@@ -9159,7 +9199,11 @@
 	if (NamedLStyle.isEmpty())
 	{
 		if ((lineColor() != CommonStrings::None) || (!patternStrokeVal.isEmpty()) || (GrTypeStroke > 0))
+		{
 			extraSpace = m_lineWidth;
+			if ((extraSpace == 0) && m_Doc->view()) // Hairline case
+				extraSpace = 1.0 / m_Doc->view()->scale();
+		}
 		if ((!patternStrokeVal.isEmpty()) && (m_Doc->docPatterns.contains(patternStrokeVal)) && (patternStrokePath))
 		{
 			ScPattern *pat = &m_Doc->docPatterns[patternStrokeVal];
@@ -9174,9 +9218,13 @@
 	else
 	{
 		multiLine ml = m_Doc->MLineStyles[NamedLStyle];
-		struct SingleLine& sl = ml[ml.size()-1];
-		if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
+		const SingleLine& sl = ml.last();
+		if (sl.Color != CommonStrings::None)
+		{
 			extraSpace = sl.Width;
+			if ((extraSpace == 0) && m_Doc->view()) // Hairline case
+				extraSpace = 1.0 / m_Doc->view()->scale();
+		}
 	}
 	return extraSpace;
 }

Modified: trunk/Scribus/scribus/pageitem_line.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22352&path=/trunk/Scribus/scribus/pageitem_line.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_line.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_line.cpp	Wed Jan 17 22:10:47 2018
@@ -272,6 +272,8 @@
 		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))
 		{
@@ -287,9 +289,13 @@
 	else
 	{
 		multiLine ml = m_Doc->MLineStyles[NamedLStyle];
-		struct SingleLine& sl = ml[ml.size()-1];
-		if ((sl.Color != CommonStrings::None) && (sl.Width != 0))
+		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();
+		}
 	}
 	if (m_rotation != 0)
 	{




More information about the scribus-commit mailing list