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:
PeterN 2022-09-10 17:48:38 +01:00 committed by GitHub
parent 0355299639
commit f279fc5772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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;