Merge branch 'master' into feat-supsub
This commit is contained in:
@@ -1064,6 +1064,28 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
|
||||
self->preUntilDepth = std::min(self->preUntilDepth, self->depth);
|
||||
}
|
||||
}
|
||||
} else if (strcmp(name, "hr") == 0) {
|
||||
if (self->partWordBufferIndex > 0) {
|
||||
if (!self->flushPartWordBuffer()) return;
|
||||
}
|
||||
self->makePages();
|
||||
if (!self->currentPage) {
|
||||
self->currentPage.reset(new Page());
|
||||
self->currentPageNextY = 0;
|
||||
}
|
||||
const int lineHeight = static_cast<int>(self->renderer.getLineHeight(self->fontId) * self->lineCompression + 0.5f);
|
||||
const int16_t marginV = static_cast<int16_t>(lineHeight / 2);
|
||||
self->currentPageNextY += marginV;
|
||||
if (self->currentPageNextY + 1 + marginV > self->viewportHeight) {
|
||||
self->emitPage(self->lastBodyChildByteOffset);
|
||||
self->currentPage.reset(new Page());
|
||||
self->currentPageNextY = 0;
|
||||
}
|
||||
self->currentPage->elements.push_back(
|
||||
std::make_shared<PageHR>(0, self->currentPageNextY, static_cast<int16_t>(self->viewportWidth)));
|
||||
self->currentPageNextY += 1 + marginV;
|
||||
BlockStyle emptyStyle;
|
||||
self->startNewTextBlock(emptyStyle);
|
||||
} else if (matches(name, UNDERLINE_TAGS, NUM_UNDERLINE_TAGS) ||
|
||||
matches(name, STRIKETHROUGH_TAGS, NUM_STRIKETHROUGH_TAGS)) {
|
||||
// Flush buffer before style change so preceding text gets current style
|
||||
|
||||
Reference in New Issue
Block a user