Skip to content

Commit 86ece3f

Browse files
committed
Use SDL_fabsf inside SDL_FRectEqualsEpsilon
1 parent 786ae36 commit 86ece3f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

units/sdl2.pas

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ function SDL_FRectEmpty(const r: PSDL_FRect): Boolean;
291291
Result := (r = NIL) or (r^.w <= cfloat(0.0)) or (r^.h <= cfloat(0.0))
292292
end;
293293

294-
{ FIXME: This the Pascal System.Abs() function, instead of the C SDL_fabsf() function. }
295294
function SDL_FRectEqualsEpsilon(const a, b: PSDL_FRect; const epsilon: cfloat): Boolean;
296295
begin
297296
Result :=
@@ -301,13 +300,13 @@ function SDL_FRectEqualsEpsilon(const a, b: PSDL_FRect; const epsilon: cfloat):
301300
(a = b)
302301
or
303302
(
304-
(Abs(a^.x - b^.x) <= epsilon)
303+
(SDL_fabsf(a^.x - b^.x) <= epsilon)
305304
and
306-
(Abs(a^.y - b^.y) <= epsilon)
305+
(SDL_fabsf(a^.y - b^.y) <= epsilon)
307306
and
308-
(Abs(a^.w - b^.w) <= epsilon)
307+
(SDL_fabsf(a^.w - b^.w) <= epsilon)
309308
and
310-
(Abs(a^.h - b^.h) <= epsilon)
309+
(SDL_fabsf(a^.h - b^.h) <= epsilon)
311310
)
312311
)
313312
end;

0 commit comments

Comments
 (0)