This commit is contained in:
jpirnay
2026-04-25 11:19:39 +02:00
parent 12372aaafc
commit 81a784985e
+6 -4
View File
@@ -293,8 +293,9 @@ std::vector<size_t> ParsedText::computeLineBreaks(const GfxRenderer& renderer, c
// Calculate first line indent (only for left/justified text). // Calculate first line indent (only for left/justified text).
// Explicit CSS text-indent always applies — author intent overrides the extraParagraphSpacing // Explicit CSS text-indent always applies — author intent overrides the extraParagraphSpacing
// toggle. Only the implicit EmSpace fallback in applyParagraphIndent() is gated on it. // toggle. Only the implicit EmSpace fallback in applyParagraphIndent() is gated on it.
const int firstLineIndent = blockStyle.textIndentDefined && (blockStyle.alignment == CssTextAlign::Justify || const int firstLineIndent =
blockStyle.alignment == CssTextAlign::Left) blockStyle.textIndentDefined &&
(blockStyle.alignment == CssTextAlign::Justify || blockStyle.alignment == CssTextAlign::Left)
? std::min(std::max<int>(static_cast<int>(blockStyle.textIndent), -(pageWidth - 1)), pageWidth - 1) ? std::min(std::max<int>(static_cast<int>(blockStyle.textIndent), -(pageWidth - 1)), pageWidth - 1)
: 0; : 0;
@@ -494,8 +495,9 @@ std::vector<size_t> ParsedText::computeHyphenatedLineBreaks(const GfxRenderer& r
// Calculate first line indent (only for left/justified text). // Calculate first line indent (only for left/justified text).
// Explicit CSS text-indent always applies — author intent overrides the extraParagraphSpacing // Explicit CSS text-indent always applies — author intent overrides the extraParagraphSpacing
// toggle. Only the implicit EmSpace fallback in applyParagraphIndent() is gated on it. // toggle. Only the implicit EmSpace fallback in applyParagraphIndent() is gated on it.
const int firstLineIndent = blockStyle.textIndentDefined && (blockStyle.alignment == CssTextAlign::Justify || const int firstLineIndent =
blockStyle.alignment == CssTextAlign::Left) blockStyle.textIndentDefined &&
(blockStyle.alignment == CssTextAlign::Justify || blockStyle.alignment == CssTextAlign::Left)
? std::min(std::max<int>(static_cast<int>(blockStyle.textIndent), -(pageWidth - 1)), pageWidth - 1) ? std::min(std::max<int>(static_cast<int>(blockStyle.textIndent), -(pageWidth - 1)), pageWidth - 1)
: 0; : 0;