Fix: DrawStringMultiLine() could overdraw (#10014)

This function did not take the line height into account when checking text will fit before the bottom bounds.
pull/434/head
PeterN 2 years ago committed by GitHub
parent 0355299639
commit f279fc5772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save