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

An empty cliprect causes clipping to be disabled #1447

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

An empty cliprect causes clipping to be disabled #1447

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.3
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2014-04-19 19:44:56 +0000, (disabled) Jørgen Tjernø wrote:

Doing the following does not do what is expected:

SDL_Rect rect = { 0, 0, 0, 0 };
SDL_RenderSetClipRect(pRenderer, &rect);

Expected behavior:

  • Clip every draw, preventing any rendering from happening.

Actual behavior:

  • Disable clipping entirely, allowing every render to render to each pixel.

The comments for SDL_RenderSetClipRect's second parameter say: "A pointer to the rectangle to set as the clip rectangle, or NULL to disable clipping."

This seems to just be a bug, since it internally sets the clip rect to a zero rect when you disable clipping, so the underlying subsystems can't distinguish from an empty rect and clipping disabled.

On 2014-04-19 19:45:14 +0000, (disabled) Jørgen Tjernø wrote:

I'll be fixing this.

On 2014-04-19 20:22:43 +0000, (disabled) Jørgen Tjernø wrote:

Fixed in https://hg.libsdl.org/SDL/rev/c7174f961388

Sam: Can you review the change and close the bug if it looks good?

On 2014-04-19 21:48:34 +0000, Sam Lantinga wrote:

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant