-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Preserve DragFloat from changing value when overlap #4702
Comments
Hello, Your question is worded as too specifically (and maybe a XY Problem, this does not have much to do with DragFloat(). We can attempt to make AllowOverlap work with groups if it doesn't already, but please provide a minimum repro to first see if that is the case. Otherwise you should use individual windows as a delimiter for hovering. |
Thanks for fast response - Sorry for XY My node_editor is quite similar to https://github.com/thedmd/imgui-node-editor -> nodes are not window, but Groups of other elements -> than they can overlap -> when I grab and drag node (Group) I also fire changing value on underlying DragFloat - which I dont want. |
I am sorry for being late... Repro code is: ImGui::SetCursorPos(ImVec2(100, 100)); ImGui::SetCursorPos(text_position); if (moving_text && ImGui::IsMouseDragging(0)) If you move text over the DragFloat, release mouse and then drag text by some point that overlap with DragFloat -> you move with text and change value in DragFloat too... I do not want change value in DragFloat in this case. In my real scenario are two cases:
|
@ocornut I am just not sure whether repro code ping you. |
Sorry this is too tricky and ambiguous to understand. This is not much a question about drag float. I think maybe you should use BeginDisabled() or underlying |
OK, maybe more general issue is possibility of disabling interaction of lower item when two items overlap for "all item types" (as button behave). When I want to use ImGuiItemFlags_Disabled, I have to compute whether or not Text overlap DragFloat (in my example) - which is not easy computation. And somewhere in Imgui this computation already run (for buttons at least) |
No computation is running. Hovering is given on a first-submitted first-served basis by default, and with AllowOverlap it allows override + checks the previous frame value ( |
Version: 1.85
Branch: master
Is it possible somehow preserve (deactivate) DragFloat from changing its value (by dragging) in situation where DragFloat is overlapped by other widget (in my case Group ) and I drag this widget (Group)?
I simply want to move with Group in front (I make "node_editor" and Group is movable node ) and not change value of DragFloat in back.
Thank you.
I try to set AllowOverlap by #3909 (comment)
But this seem to work for two overalapped DragFloat -> I want to use it in case when DragFloat is overlapped by Group...
The text was updated successfully, but these errors were encountered: