1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 09:59:10 +00:00

Fix: DrawStringMultiLine() could overdraw (#10014)

This function did not take the line height into account when checking text will fit before the bottom bounds.
This commit is contained in:
2022-09-10 17:48:38 +01:00
committed by GitHub
parent 0355299639
commit f279fc5772

View File

@@ -819,7 +819,7 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, const char *st
for (const auto &line : layout) {
int line_height = line->GetLeading();
if (y >= top && y < bottom) {
if (y >= top && y + line_height - 1 <= bottom) {
last_line = y + line_height;
if (first_line > y) first_line = y;