fix compilation errors
This commit is contained in:
parent
750a6ee1d8
commit
5c9412b141
@ -99,7 +99,8 @@ std::vector<uint16_t> ParsedText::calculateWordWidths(const GfxRenderer& rendere
|
|||||||
uint16_t width = measureWordWidth(renderer, fontId, *wordsIt, *wordStylesIt);
|
uint16_t width = measureWordWidth(renderer, fontId, *wordsIt, *wordStylesIt);
|
||||||
|
|
||||||
// Add CSS text-indent to first word width
|
// 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);
|
width += static_cast<uint16_t>(blockStyle.textIndent);
|
||||||
isFirst = false;
|
isFirst = false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -36,9 +36,11 @@ class ParsedText {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ParsedText(const TextBlock::Style style, const bool extraParagraphSpacing,
|
explicit ParsedText(const TextBlock::Style style, const bool extraParagraphSpacing,
|
||||||
const bool hyphenationEnabled = false,
|
const bool hyphenationEnabled = false, const BlockStyle& blockStyle = BlockStyle())
|
||||||
const BlockStyle& blockStyle = BlockStyle()))
|
: style(style),
|
||||||
: style(style), extraParagraphSpacing(extraParagraphSpacing), hyphenationEnabled(hyphenationEnabled, blockStyle(blockStyle)) {}
|
blockStyle(blockStyle),
|
||||||
|
extraParagraphSpacing(extraParagraphSpacing),
|
||||||
|
hyphenationEnabled(hyphenationEnabled) {}
|
||||||
~ParsedText() = default;
|
~ParsedText() = default;
|
||||||
|
|
||||||
void addWord(std::string word, EpdFontFamily::Style fontStyle, bool underline = false);
|
void addWord(std::string word, EpdFontFamily::Style fontStyle, bool underline = false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user