Some code tweaks

This commit is contained in:
raysan5 2016-01-23 13:22:13 +01:00
parent 6e9d3eb0f9
commit 08da91047e
5 changed files with 11 additions and 16 deletions

View file

@ -397,8 +397,8 @@ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec)
int recCenterX = rec.x + rec.width/2;
int recCenterY = rec.y + rec.height/2;
float dx = abs(center.x - recCenterX);
float dy = abs(center.y - recCenterY);
float dx = fabs(center.x - recCenterX);
float dy = fabs(center.y - recCenterY);
if (dx > (rec.width/2 + radius)) { return false; }
if (dy > (rec.height/2 + radius)) { return false; }