r21836 by jghali - #14684: With frame breaks, vertical text alignment does not work except in the last linked text frame
scribus-commit
scribus-commit at lists.scribus.net
Fri Mar 17 00:02:12 UTC 2017
Author: jghali
Date: Fri Mar 17 00:02:12 2017
New Revision: 21836
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21836
Log:
#14684: With frame breaks, vertical text alignment does not work except in the last linked text frame
Modified:
trunk/Scribus/scribus/pageitem_textframe.cpp
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21836&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Fri Mar 17 00:02:12 2017
@@ -2987,7 +2987,7 @@
}
}
MaxChars = itemText.length();
- if ((verticalAlign > 0) && (NextBox == NULL))
+ if (verticalAlign > 0)
{
double hAdjust = height() - textLayout.box()->naturalHeight() - m_textDistanceMargins.bottom();
if (hAdjust > 0)
@@ -3038,6 +3038,28 @@
invalid = false;
adjustParagraphEndings ();
+
+ if (verticalAlign > 0)
+ {
+ double hAdjust = height() - textLayout.box()->naturalHeight() - m_textDistanceMargins.bottom();
+ if (hAdjust > 0)
+ {
+ if (verticalAlign == 1)
+ hAdjust /= 2;
+ if (FrameType == 0) // Rectangular frame
+ textLayout.box()->moveBy(0, hAdjust);
+ else
+ {
+ int vertAlign = verticalAlign;
+ double topDist = m_textDistanceMargins.top();
+ m_textDistanceMargins.setTop(topDist + hAdjust);
+ verticalAlign = 0;
+ layout();
+ verticalAlign = vertAlign;
+ m_textDistanceMargins.setTop(topDist);
+ }
+ }
+ }
if (!isNoteFrame() && (!m_Doc->notesList().isEmpty() || m_Doc->notesChanged()))
{
More information about the scribus-commit
mailing list