Corrected bug on GetCollisionRec()
This commit is contained in:
parent
d0e26247f4
commit
ee52b13ae6
1 changed files with 18 additions and 3 deletions
15
src/shapes.c
15
src/shapes.c
|
@ -430,9 +430,24 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
|
|||
}
|
||||
}
|
||||
|
||||
if (rec1.width > rec2.width)
|
||||
{
|
||||
if (retRec.width >= rec2.width) retRec.width = rec2.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (retRec.width >= rec1.width) retRec.width = rec1.width;
|
||||
}
|
||||
|
||||
if (rec1.height > rec2.height)
|
||||
{
|
||||
if (retRec.height >= rec2.height) retRec.height = rec2.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (retRec.height >= rec1.height) retRec.height = rec1.height;
|
||||
}
|
||||
}
|
||||
|
||||
return retRec;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue