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

Clip negative #54

Merged
merged 2 commits into from
Aug 27, 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 e3b13a3923cbe3e46c231b4f2817d2f0cabb58f9
* Continue rebasing from 98d94808f26240a1e7af77513a146cc9c2a870fd
* Add a focus listener interface.
* Make focus apply synchronously.
* Graphics and input objects for DirectX.
Expand Down
8 changes: 8 additions & 0 deletions src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ namespace gcn

bool Graphics::pushClipArea(Rectangle area)
{
// Ignore area with a negative width or height
// by simple pushing an empty clip area to the stack.
if (area.width < 0 || area.height < 0)
{
ClipRectangle carea;
mClipStack.push(carea);
return true;
}
if (mClipStack.empty())
{
ClipRectangle carea;
Expand Down