diff options
| author | mandar1jn <[email protected]> | 2021-10-24 18:24:01 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-24 18:24:01 +0200 |
| commit | affb707dd939b7c9c6c873beb05a7baf17a8c7bd (patch) | |
| tree | 9fe6142efc1d553bd6b1d0b30e3918544998fe1e | |
| parent | 4c497779a2c5686c6933fab93000c23794040e5d (diff) | |
| download | raylib-affb707dd939b7c9c6c873beb05a7baf17a8c7bd.tar.gz raylib-affb707dd939b7c9c6c873beb05a7baf17a8c7bd.zip | |
fixing the library so the workflows compile (#2082)
| -rw-r--r-- | src/rshapes.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rshapes.c b/src/rshapes.c index f3f360a9..9ad5a3d5 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -1638,15 +1638,15 @@ bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, { const float div = (endPos2.y - startPos2.y)*(endPos1.x - startPos1.x) - (endPos2.x - startPos2.x)*(endPos1.y - startPos1.y); - if (abs(div) < FLT_EPSILON) return false; + if (fabsf(div) < FLT_EPSILON) return false; const float xi = ((startPos2.x - endPos2.x)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.x - endPos1.x)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div; const float yi = ((startPos2.y - endPos2.y)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.y - endPos1.y)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div; - if (abs(startPos1.x - endPos1.x) > FLT_EPSILON && (xi < fminf(startPos1.x, endPos1.x) || xi > fmaxf(startPos1.x, endPos1.x))) return false; - if (abs(startPos2.x - endPos2.x) > FLT_EPSILON && (xi < fminf(startPos2.x, endPos2.x) || xi > fmaxf(startPos2.x, endPos2.x))) return false; - if (abs(startPos1.y - endPos1.y) > FLT_EPSILON && (yi < fminf(startPos1.y, endPos1.y) || yi > fmaxf(startPos1.y, endPos1.y))) return false; - if (abs(startPos2.y - endPos2.y) > FLT_EPSILON && (yi < fminf(startPos2.y, endPos2.y) || yi > fmaxf(startPos2.y, endPos2.y))) return false; + if (fabsf(startPos1.x - endPos1.x) > FLT_EPSILON && (xi < fminf(startPos1.x, endPos1.x) || xi > fmaxf(startPos1.x, endPos1.x))) return false; + if (fabsf(startPos2.x - endPos2.x) > FLT_EPSILON && (xi < fminf(startPos2.x, endPos2.x) || xi > fmaxf(startPos2.x, endPos2.x))) return false; + if (fabsf(startPos1.y - endPos1.y) > FLT_EPSILON && (yi < fminf(startPos1.y, endPos1.y) || yi > fmaxf(startPos1.y, endPos1.y))) return false; + if (fabsf(startPos2.y - endPos2.y) > FLT_EPSILON && (yi < fminf(startPos2.y, endPos2.y) || yi > fmaxf(startPos2.y, endPos2.y))) return false; if (collisionPoint != 0) { |
