mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 19:38:15 +00:00
Corrected bug on GetCollisionRec()
This commit is contained in:
19
src/shapes.c
19
src/shapes.c
@@ -430,8 +430,23 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
|
||||
}
|
||||
}
|
||||
|
||||
if (retRec.width >= rec2.width) retRec.width = rec2.width;
|
||||
if (retRec.height >= rec2.height) retRec.height = rec2.height;
|
||||
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;
|
||||
|
Reference in New Issue
Block a user