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

Apply guichan fix 79e81ca83f124b961eedfc7ecd5fd5618c5d97df (Jan 2nd 2008). #31

Merged
merged 1 commit into from
Aug 3, 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 TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* Continue rebasing from b62d153a5dd699add2109671d4569578dd4f2671
* Continue rebasing from f385b61e8f328c325d72d84280670771672a6509
* Add a focus listener interface.
* Make focus apply synchronously.
* Graphics and input objects for DirectX.
Expand Down
16 changes: 9 additions & 7 deletions src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,24 @@ namespace gcn
// Clamp the pushed clip rectangle.
if (carea.x < top.x)
{
carea.x = top.x;
carea.width += carea.x - top.x;
carea.x = top.x;
}

if (carea.y < top.y)
{
carea.y = top.y;
carea.height += carea.y - top.y;
carea.y = top.y;
}

if (carea.width > top.width)
{
carea.width = top.width;
carea.width = top.width;
}

if (carea.height > top.height)
{
carea.height = top.height;
carea.height = top.height;
}

bool result = carea.intersect(top);
Expand Down
6 changes: 4 additions & 2 deletions src/sdl/sdl2graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ namespace gcn
rect.y = carea.y;
rect.w = carea.width;
rect.h = carea.height;

SDL_RenderSetClipRect(mRenderTarget, &rect);
if (result)
{
SDL_RenderSetClipRect(mRenderTarget, &rect);
}

return result;
}
Expand Down