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

Added ResetOperation to fix IsOver() reporting #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unadkat
Copy link

@unadkat unadkat commented Dec 2, 2024

Relates to/adds functionality to fix #132, #133, #310.

I've been noticing the same issue as these previous reports, where IsOver() is reporting true even when I'm not drawing a gizmo:
gizmo.webm

I've added a low-footprint fix to errant IsOver() return values when stopping gizmo drawing and having the mouse cursor over the spot where the gizmo would have been drawn. The key issue is out-of-path logic that stops gizmo drawing, since IsOver() uses cached operation flags from the last Manipulate call to decide if the mouse is over a gizmo, whether it's being drawn or not.

Adding the capability to (re)set the operation flag allows for the correct result from IsOver() without needing to send a call through Manipulate just to reset the flag. There was a suggestion in the previous reports that users could track the gizmo drawing state and use that in conjunction with IsOver(), but I think it's useful to have a way to correct the cached operation flag.

Resetting the operation flag but leaving the rest of the cache intact,
so that users can stop drawing a gizmo and have IsOver() reporting
correctly (while not losing the other cached info).
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.

ImGuizmo::IsOver() returns 'true' when hovering in certain locations around the gizmo
1 participant