[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.)
This commit is contained in:
parent
935f3da3ff
commit
9f9c11db41
1 changed files with 3 additions and 1 deletions
|
|
@ -631,7 +631,9 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color)
|
||||||
// Draw rectangle outline with line thickness
|
// Draw rectangle outline with line thickness
|
||||||
void DrawRectangleLinesEx(Rectangle rec, float thick, Color color)
|
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;
|
if (rec.width >= rec.height) thick = rec.height/2;
|
||||||
else if (rec.width <= rec.height) thick = rec.width/2;
|
else if (rec.width <= rec.height) thick = rec.width/2;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue