From c9388384e0429b07cf40ccb5b73bfbeadfbe5f88 Mon Sep 17 00:00:00 2001 From: Samuel Ugochukwu Date: Sun, 8 Dec 2024 15:34:45 +0100 Subject: [PATCH] Update pagination algorithm --- source/layout/fragmentbuilder.cpp | 6 +++--- source/plutobook.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/layout/fragmentbuilder.cpp b/source/layout/fragmentbuilder.cpp index 8e1c277..280db04 100644 --- a/source/layout/fragmentbuilder.cpp +++ b/source/layout/fragmentbuilder.cpp @@ -11,17 +11,17 @@ PageBuilder::PageBuilder(const Book* book) float PageBuilder::applyFragmentBreakBefore(const BoxFrame* child, float offset) { - return 0.f; + return offset; } float PageBuilder::applyFragmentBreakAfter(const BoxFrame* child, float offset) { - return 0.f; + return offset; } float PageBuilder::applyFragmentBreakInside(const BoxFrame* child, float offset) { - return 0.f; + return offset; } float PageBuilder::fragmentHeightForOffset(float offset) const diff --git a/source/plutobook.cpp b/source/plutobook.cpp index c541385..8193b9c 100644 --- a/source/plutobook.cpp +++ b/source/plutobook.cpp @@ -571,7 +571,7 @@ Document* Book::layoutIfNeeded() const { auto document = buildIfNeeded(); if(document && m_needsLayout) { - if(m_mediaType != MediaType::Print) { + if(m_mediaType == MediaType::Print) { PageBuilder builder(this); document->layout(&builder); } else {