fix shiftY calculation typo (#285)

This commit is contained in:
Ruslan Myhal
2022-05-20 10:31:35 +01:00
committed by GitHub
parent ead49d29eb
commit 7e133e3bdf

View File

@@ -145,7 +145,7 @@ void align(Shaping& shaping,
if (maxLineHeight != lineHeight) {
shiftY = -blockHeight * verticalAlign - Shaping::yOffset;
} else {
shiftY = (-verticalAlign * static_cast<float>(lineCount + 0.5)) * lineHeight;
shiftY = (-verticalAlign * static_cast<float>(lineCount) + 0.5f) * lineHeight;
}
for (auto& line : shaping.positionedLines) {