Skip to content

Commit

Permalink
Fix under by one error in FillRect on SDL driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
OmniBlade committed Jun 13, 2024
1 parent ad33383 commit dc59bd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/video_sdl1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ class VideoSurfaceSDL1 : public VideoSurface

virtual void FillRect(const Rect& rect, unsigned char color)
{
SDL_Rect rectSDL = {rect.X, rect.Y, rect.Width, rect.Height};
SDL_Rect rectSDL = {rect.X, rect.Y, rect.Width + 1, rect.Height + 1};
SDL_FillRect(surface, &rectSDL, color);
}

Expand Down
3 changes: 2 additions & 1 deletion common/video_sdl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,8 @@ class VideoSurfaceSDL2 : public VideoSurface

virtual void FillRect(const Rect& rect, unsigned char color)
{
SDL_FillRect(surface, (SDL_Rect*)(&rect), color);
SDL_Rect rectSDL = {rect.X, rect.Y, rect.Width + 1, rect.Height + 1};
SDL_FillRect(surface, &rectSDL, color);
}

void RenderSurface()
Expand Down

0 comments on commit dc59bd0

Please sign in to comment.