r24271 by jghali - #16325: Fix sometime disappearing space in text after flow around object

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 21 23:53:31 UTC 2020


Author: jghali
Date: Sat Nov 21 23:53:31 2020
New Revision: 24271

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24271
Log:
#16325: Fix sometime disappearing space in text after flow around object

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24271&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Sat Nov 21 23:53:31 2020
@@ -1851,7 +1851,8 @@
 			maxYDesc = current.yPos + realDesc;
 			if (style.lineSpacingMode() != ParagraphStyle::AutomaticLineSpacing)
 			{
-				maxYAsc = qMin(maxYAsc, qMax(0.0, current.yPos - asce));
+				// #11727, #11628, etc.
+				maxYAsc = qMax(0.0, qMin(maxYAsc, current.yPos - asce));
 				maxYDesc = current.yPos + desc;
 			}
 
@@ -1934,7 +1935,8 @@
 						maxYDesc = current.yPos + realDesc;
 						if (style.lineSpacingMode() != ParagraphStyle::AutomaticLineSpacing)
 						{
-							maxYAsc = qMin(maxYAsc, qMax(0.0, current.yPos - asce));
+							// #11727, #11628, etc.
+							maxYAsc = qMax(0.0, qMin(maxYAsc, current.yPos - asce));
 							maxYDesc = current.yPos + desc;
 						}
 
@@ -2810,7 +2812,12 @@
 					if (firstLineOffset() == FLOPRealGlyphHeight)
 						addAsce = realAsce;
 					else if (firstLineOffset() == FLOPLineSpacing)
-						addAsce = style.lineSpacing() + offset;
+					{
+						if (DropCmode)
+							addAsce = DropCapDrop + style.lineSpacing();
+						else
+							addAsce = style.lineSpacing();
+					}
 				}
 				maxYAsc = current.yPos - addAsce;
 			}
@@ -2820,16 +2827,15 @@
 			maxYAsc = qMax(maxYAsc, 0.0);
 			maxYDesc = current.yPos + realDesc;
 
-			if (style.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
-			{
-				regionMinY = static_cast<int>(floor(maxYAsc));
-				regionMaxY = static_cast<int>(floor(maxYDesc));
-			}
-			else // #11727, #11628, etc.
-			{
-				regionMinY = static_cast<int>(qMax(0.0, floor(current.yPos - (realAsce + offset))));
-				regionMaxY = static_cast<int>(floor(current.yPos + realDesc));
-			}
+			if (style.lineSpacingMode() != ParagraphStyle::AutomaticLineSpacing)
+			{
+				// #11727, #11628, etc.
+				maxYAsc = qMax(0.0, qMin(maxYAsc, current.yPos - asce));
+				maxYDesc = current.yPos + desc;
+			}
+
+			regionMinY = static_cast<int>(floor(maxYAsc));
+			regionMaxY = static_cast<int>(floor(maxYDesc));
 
 			EndX = current.endOfLine(m_availableRegion, style.rightMargin(), regionMinY, regionMaxY);
 			current.finishLine(EndX - current.rightIndent);




More information about the scribus-commit mailing list