Fix spacing calculation for justified text in extractLine method

This commit is contained in:
Arthur Tazhitdinov 2025-12-26 01:55:24 +05:00
parent 4ee9783e49
commit a1f82308e4

View File

@ -325,6 +325,7 @@ void ParsedText::extractLine(const size_t breakIndex, const int pageWidth, const
int spacing = spaceWidth;
const bool isLastLine = breakIndex == lineBreakIndices.size() - 1;
if (style == TextBlock::JUSTIFIED && !isLastLine && lineWordCount >= 2) {
spacing = spareSpace / (lineWordCount - 1);
}