1
0
Эх сурвалжийг харах

Fix right, bottom computation in `SDL_GetClosestPointOnRect` which should be exclusive, not inclusive

Sam Lantinga 2 жил өмнө
parent
commit
7530bd74b3
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      src/video/SDL_video.c

+ 2 - 2
src/video/SDL_video.c

@@ -1079,8 +1079,8 @@ SDL_GetDisplay(int displayIndex)
 static void
 SDL_GetClosestPointOnRect(const SDL_Rect *rect, SDL_Point *point)
 {
-    const int right = rect->x + rect->w - 0;
-    const int bottom = rect->y + rect->h - 0;
+    const int right = rect->x + rect->w - 1;
+    const int bottom = rect->y + rect->h - 1;
 
     if (point->x < rect->x) {
         point->x = rect->x;