Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix under by one error in FillRect on SDL driver. #1000

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading