fix compilation errors

This commit is contained in:
Jake Kenneally 2026-01-19 23:09:35 -06:00
parent 750a6ee1d8
commit 5c9412b141
2 changed files with 7 additions and 4 deletions

View File

@ -99,7 +99,8 @@ std::vector<uint16_t> ParsedText::calculateWordWidths(const GfxRenderer& rendere
uint16_t width = measureWordWidth(renderer, fontId, *wordsIt, *wordStylesIt);
// Add CSS text-indent to first word width
if (isFirst && blockStyle.textIndent > 0 && shouldIndent) {
if (isFirst && blockStyle.textIndent > 0 && (style == TextBlock::JUSTIFIED || style == TextBlock::LEFT_ALIGN) &&
!extraParagraphSpacing) {
width += static_cast<uint16_t>(blockStyle.textIndent);
isFirst = false;
} else {

View File

@ -36,9 +36,11 @@ class ParsedText {
public:
explicit ParsedText(const TextBlock::Style style, const bool extraParagraphSpacing,
const bool hyphenationEnabled = false,
const BlockStyle& blockStyle = BlockStyle()))
: style(style), extraParagraphSpacing(extraParagraphSpacing), hyphenationEnabled(hyphenationEnabled, blockStyle(blockStyle)) {}
const bool hyphenationEnabled = false, const BlockStyle& blockStyle = BlockStyle())
: style(style),
blockStyle(blockStyle),
extraParagraphSpacing(extraParagraphSpacing),
hyphenationEnabled(hyphenationEnabled) {}
~ParsedText() = default;
void addWord(std::string word, EpdFontFamily::Style fontStyle, bool underline = false);