Skip to content

Commit

Permalink
Merge pull request #2557 from flackr/increase-overdraw
Browse files Browse the repository at this point in the history
Increase overdraw amount used by SDL_RenderCopyF
  • Loading branch information
TheCycoONE committed Apr 15, 2024
2 parents fba1775 + 940ad69 commit 0c84aaf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CorsixTH/Src/th_gfx_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SOFTWARE.
#if SDL_VERSION_ATLEAST(2, 0, 10)

//! How much to overdraw scaled sprites to ensure no gaps are visible.
const float frect_overdraw = 0.002f;
const float frect_overdraw = 0.01f;

#define SDL_FRECT_UNIT float
#else
Expand Down Expand Up @@ -183,8 +183,8 @@ void getScaleRect(const SDL_Rect* rect, double scale_factor,
// on scaled rendering.
dst_rect->x = static_cast<float>(rect->x * scale_factor) - frect_overdraw;
dst_rect->y = static_cast<float>(rect->y * scale_factor) - frect_overdraw;
dst_rect->w = static_cast<float>(rect->w * scale_factor) + frect_overdraw;
dst_rect->h = static_cast<float>(rect->h * scale_factor) + frect_overdraw;
dst_rect->w = static_cast<float>(rect->w * scale_factor) + 2 * frect_overdraw;
dst_rect->h = static_cast<float>(rect->h * scale_factor) + 2 * frect_overdraw;
#else
// Prior to SDL 2.0.10, fallback to using the enclosing integer SDL_Rect for
// scaled rendering.
Expand Down

0 comments on commit 0c84aaf

Please sign in to comment.