DrawArt: Fix bounds check (#3395)
The bounds checks were performed against the global screen dimensions instead of the output buffer dimensions. Also includes some minor cleanup of DrawArt. Fixes #3388
This commit is contained in:
parent
b5d96665c9
commit
117695489b
3 changed files with 10 additions and 18 deletions
|
|
@ -346,7 +346,7 @@ uint32_t DrawString(const Surface &out, string_view text, const Rectangle &rect,
|
|||
characterPosition.x += rect.size.width - lineWidth;
|
||||
|
||||
int rightMargin = rect.position.x + rect.size.width;
|
||||
int bottomMargin = rect.size.height != 0 ? rect.position.y + rect.size.height : out.h();
|
||||
const int bottomMargin = rect.size.height != 0 ? std::min(rect.position.y + rect.size.height, out.h()) : out.h();
|
||||
|
||||
if (lineHeight == -1)
|
||||
lineHeight = LineHeights[size];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue