From 05de187667ddac5be6f04a898049c9b743becf72 Mon Sep 17 00:00:00 2001 From: Nep2Disk Date: Sat, 22 Feb 2025 18:08:13 +0000 Subject: [PATCH] Fix patches being turned inside-out by cliprect in GL Turns out the reason the chat looks strange in LegacyGL is because of cliprect. This is a fix that was done by GenericHeroGuy for one of my other projects. --- src/hardware/hw_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index b26eaa2c2..d4ba78614 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -267,8 +267,8 @@ void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t p cx = cx1; cy = cy1; - fwidth = cx2 - cx1; - fheight = cy2 - cy1; + fwidth = fmaxf(0.0f, cx2 - cx1); + fheight = fmaxf(0.0f, cy2 - cy1); } // positions of the cx, cy, are between 0 and vid.width/vid.height now, we need them to be between -1 and 1