Skip to content

Commit

Permalink
Fix rectangle width and height check to account for squares (#4382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshalosh authored Oct 15, 2024
1 parent 8d267aa commit c9c830c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rshapes.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,8 @@ void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color)
{
if ((lineThick > rec.width) || (lineThick > rec.height))
{
if (rec.width > rec.height) lineThick = rec.height/2;
else if (rec.width < rec.height) lineThick = rec.width/2;
if (rec.width >= rec.height) lineThick = rec.height/2;
else if (rec.width <= rec.height) lineThick = rec.width/2;
}

// When rec = { x, y, 8.0f, 6.0f } and lineThick = 2, the following
Expand Down

0 comments on commit c9c830c

Please sign in to comment.