ImGuizmo icon indicating copy to clipboard operation
ImGuizmo copied to clipboard

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

Open AndreiDespinoiu opened this issue 4 years ago • 9 comments

Steps to reproduce:

  1. Add this in your render loop:
std::cout << "Result is: " << std::boolalpha << ImGuizmo::IsOver() << '\n';
  1. While the gizmo is visible, hover the mouse cursor around it, avoiding the actual elements that comprise the gizmo.

The following occurs: The IsOver() function returns true, regardless if the mode is set to world space or local space, and regardless if the transform operation is set to translation or scaling. Note: Also occurs while in rotation mode, on the inside of the gizmo, as if it's hitting the backside of the control circles.

Expected result: It should return true only if actual elements from the gizmo are hovered.

inconsistent_hover

Additional information: Dear ImGui 1.78 OpenGL 3.3 GLFW 3.3.2 Windows 10 (64-bit) build 1903

AndreiDespinoiu avatar Oct 06 '20 19:10 AndreiDespinoiu

I'm also getting some weirdness with the central white dot (and near the red axis) when the gizmo isn't visible:

inconsistent_while_not_visible

This shouldn't return true if the gizmo isn't drawn.

if (isGuiGizmoVisible)
{
       ImGuizmo::Manipulate(...);
}

Here isGuiGizmoVisible is a boolean that I'm toggling on and off.

Maybe it's a different bug? Eh... I'm mentioning it here as a comment because they seem related.

AndreiDespinoiu avatar Oct 06 '20 20:10 AndreiDespinoiu

That's interesting. Let me check that :)

CedricGuillemet avatar Oct 07 '20 10:10 CedricGuillemet

@AndreiDespinoiu Do you have a call to viewManipulate ?

CedricGuillemet avatar Oct 07 '20 15:10 CedricGuillemet

@CedricGuillemet No. Just the gizmo (ImGuizmo::Manipulate).

AndreiDespinoiu avatar Oct 07 '20 18:10 AndreiDespinoiu

@AndreiDespinoiu Can you please try to replicate the issue in the sample? You'll need to comment the line to viewManipulate because this call interfers with view/projection matrix (I'll fix that soon)

CedricGuillemet avatar Oct 08 '20 07:10 CedricGuillemet

Yes, it happens in the sample as well.

Add this line:

std::cout << "Result is: " << std::boolalpha << ImGuizmo::IsOver() << '\n';

before creating the sequencer, so that means at line 565 from main() here: https://github.com/CedricGuillemet/ImGuizmo/blob/master/example/main.cpp#L565

Obviously, you need this header at the top:

#include <iostream>

It doesn't matter if you comment out the ImGuizmo::ViewManipulate line or not.

same_issue_in_the_sample

AndreiDespinoiu avatar Oct 08 '20 09:10 AndreiDespinoiu

I'm trying again to repro ... and I get the same as you. I'm investigating now :)

CedricGuillemet avatar Oct 10 '20 15:10 CedricGuillemet

I just pushed to main branch and it should be fixed. Let me know if it works for you...or not !

CedricGuillemet avatar Oct 10 '20 16:10 CedricGuillemet

All right! This is awesome. It's fixed. Thank you so much!

Now about the white dot in the middle that I showed in the second gif... I submitted it as a separate issue, which I hope you'll take a look at: #133. Thank you!

AndreiDespinoiu avatar Oct 10 '20 17:10 AndreiDespinoiu