Test for an invalid rect in drawText

This commit is contained in:
Wayward Heart 2023-10-26 06:48:44 -05:00
parent 3744b3cf2b
commit 259caade5d

View file

@ -2015,6 +2015,11 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
GUARD_MEGA;
GUARD_ANIMATED;
// RGSS doesn't let you draw text backwards
if (rect.w <= 0 || rect.h <= 0 || rect.x >= width() || rect.y >= height() ||
rect.w < -rect.x || rect.h < -rect.y)
return;
if (hasHires()) {
Font &loresFont = getFont();
Font &hiresFont = p->selfHires->getFont();