Set correct vertical position for text following a very large image

If the document is paged and contains an image spanning more than one
page, correctly set the y position for everything following that
image.

Change-Id: I1c584c7a907c1728c2965f1dc3fdc56069ab3172
Fixes: QTBUG-59886
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
bb10
Lars Knoll 2018-11-09 10:04:54 +01:00
parent 5dde7bd922
commit 416b4cf685
1 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ struct QTextLayoutStruct {
{ return pageHeight == 0 ? 0 : (absoluteY() / pageHeight).truncate(); }
inline void newPage()
{ if (pageHeight == QFIXED_MAX) return; pageBottom += pageHeight; y = pageBottom - pageHeight + pageBottomMargin + pageTopMargin - frameY; }
{ if (pageHeight == QFIXED_MAX) return; pageBottom += pageHeight; y = qMax(y, pageBottom - pageHeight + pageBottomMargin + pageTopMargin - frameY); }
};
class QTextTableData : public QTextFrameData
@ -2709,7 +2709,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
qreal(q->paintDevice()->logicalDpiY()) / qreal(qt_defaultDpi()) : 1;
getLineHeightParams(blockFormat, line, scaling, &lineAdjustment, &lineBreakHeight, &lineHeight, &lineBottom);
if (layoutStruct->pageHeight > 0 && layoutStruct->absoluteY() + lineBreakHeight > layoutStruct->pageBottom &&
while (layoutStruct->pageHeight > 0 && layoutStruct->absoluteY() + lineBreakHeight > layoutStruct->pageBottom &&
layoutStruct->pageHeight >= lineBreakHeight) {
layoutStruct->newPage();