mirror of
https://github.com/encounter/SDL.git
synced 2025-05-23 07:41:21 +00:00
Fix right, bottom computation in SDL_GetClosestPointOnRect
which should be exclusive, not inclusive
This commit is contained in:
parent
98bac00dcc
commit
7530bd74b3
@ -1079,8 +1079,8 @@ SDL_GetDisplay(int displayIndex)
|
|||||||
static void
|
static void
|
||||||
SDL_GetClosestPointOnRect(const SDL_Rect *rect, SDL_Point *point)
|
SDL_GetClosestPointOnRect(const SDL_Rect *rect, SDL_Point *point)
|
||||||
{
|
{
|
||||||
const int right = rect->x + rect->w - 0;
|
const int right = rect->x + rect->w - 1;
|
||||||
const int bottom = rect->y + rect->h - 0;
|
const int bottom = rect->y + rect->h - 1;
|
||||||
|
|
||||||
if (point->x < rect->x) {
|
if (point->x < rect->x) {
|
||||||
point->x = rect->x;
|
point->x = rect->x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user