mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
fix: allow images to share first chapter page with title
Only force a page break before an image when it won't fit in the remaining page space, instead of unconditionally breaking whenever the page has any content.
This commit is contained in:
parent
4e80c0cc90
commit
f6847f4f83
@ -176,8 +176,9 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
|
||||
Serial.printf("[%lu] [EHP] Display size: %dx%d (scale %.2f)\n", millis(), displayWidth, displayHeight,
|
||||
scale);
|
||||
|
||||
// Create page for image
|
||||
if (self->currentPage && !self->currentPage->elements.empty()) {
|
||||
// Create page for image - only break if image won't fit remaining space
|
||||
if (self->currentPage && !self->currentPage->elements.empty() &&
|
||||
(self->currentPageNextY + displayHeight > self->viewportHeight)) {
|
||||
self->completePageFn(std::move(self->currentPage));
|
||||
self->currentPage.reset(new Page());
|
||||
if (!self->currentPage) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user