mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-31 19:33:34 +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:
parent
0355299639
commit
f279fc5772
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user