From 9f9c11db41440dff1252ba641bae46c6010909ec Mon Sep 17 00:00:00 2001 From: Matthew Roush Date: Wed, 29 Jul 2026 04:03:22 -0400 Subject: [PATCH] [rshapes] Fix `DrawRectangleLinesEx()` (#6027) Previously DrawRectangleLinesEx() would draw lines overlapping each other when they were thick enough (which was only noticeable if the color's alpha was lower than 255.) --- src/rshapes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rshapes.c b/src/rshapes.c index 76fb0c3c2..cc994b99e 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -631,7 +631,9 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) // Draw rectangle outline with line thickness void DrawRectangleLinesEx(Rectangle rec, float thick, Color color) { - if ((thick > rec.width) || (thick > rec.height)) + if (thick <= 0.0f) return; + + if ((thick > rec.width/2) || (thick > rec.height/2)) { if (rec.width >= rec.height) thick = rec.height/2; else if (rec.width <= rec.height) thick = rec.width/2;