mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-15 06:16:00 +00:00
Fixed floating point rectangles to be mathematically correct.
* A floating point rectangle contains all points >= x and <= x + w * A floating point rectangle is only empty if it has negative width. The zero rectangle contains the zero point. * Adjacent floating point rectangles intersect along their shared side Fixes https://github.com/libsdl-org/SDL/issues/6791
This commit is contained in:
@@ -90,6 +90,7 @@ SDL_bool SDL_GetSpanEnclosingRect(int width, int height,
|
||||
#define SCALARTYPE int
|
||||
#define BIGSCALARTYPE Sint64
|
||||
#define COMPUTEOUTCODE ComputeOutCode
|
||||
#define ENCLOSEPOINTS_EPSILON 1
|
||||
#define SDL_HASINTERSECTION SDL_HasRectIntersection
|
||||
#define SDL_INTERSECTRECT SDL_GetRectIntersection
|
||||
#define SDL_RECTEMPTY SDL_RectEmpty
|
||||
@@ -103,6 +104,7 @@ SDL_bool SDL_GetSpanEnclosingRect(int width, int height,
|
||||
#define SCALARTYPE float
|
||||
#define BIGSCALARTYPE double
|
||||
#define COMPUTEOUTCODE ComputeOutCodeFloat
|
||||
#define ENCLOSEPOINTS_EPSILON 0.0f
|
||||
#define SDL_HASINTERSECTION SDL_HasRectIntersectionFloat
|
||||
#define SDL_INTERSECTRECT SDL_GetRectIntersectionFloat
|
||||
#define SDL_RECTEMPTY SDL_RectEmptyFloat
|
||||
|
Reference in New Issue
Block a user