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

Add IsRectVisible() taking actual rect as parameter #768

Merged
merged 1 commit into from
Aug 6, 2016
Merged

Add IsRectVisible() taking actual rect as parameter #768

merged 1 commit into from
Aug 6, 2016

Conversation

thedmd
Copy link
Contributor

@thedmd thedmd commented Aug 5, 2016

New public function is added which allow to test arbitrary rectangle visibility without need of moving cursor.

    IMGUI_API bool          IsRectVisible(const ImVec2& a, const ImVec2& b);

I found this function useful to discard elements drawn using ImDrawList. I'm drawing background under widgets by my own using channel splitting/merging and this function simplify visibility testing.

image

@thedmd
Copy link
Contributor Author

thedmd commented Aug 5, 2016

Closed to trigger rebuild.

@thedmd thedmd closed this Aug 5, 2016
@thedmd thedmd reopened this Aug 5, 2016
@ocornut ocornut merged commit 7588dfb into ocornut:master Aug 6, 2016
ocornut added a commit that referenced this pull request Aug 6, 2016
@ocornut
Copy link
Owner

ocornut commented Aug 6, 2016

Merged with comments. The reason that wasn't exposed is that we rarely exposed rectangles to avoid window-space/screen-space confusion. So I commented on it. But IsMouseHoveringRect() also uses that and it's fine.

@thedmd thedmd deleted the 2016-08-generalized_visibility_test branch September 26, 2016 09:56
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

Successfully merging this pull request may close these issues.

2 participants