mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-06 14:24:29 +01:00
Nav: DragBehavior: Tweaks (to take the noise out of the next commit).
This commit is contained in:
parent
e5e3cc617e
commit
4932303e62
12
imgui.cpp
12
imgui.cpp
@ -8852,7 +8852,12 @@ bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_s
|
||||
// Process clicking on the drag
|
||||
if (g.ActiveId == id)
|
||||
{
|
||||
if (g.IO.MouseDown[0] || g.NavActivateDownId == id)
|
||||
if (g.ActiveIdSource == ImGuiInputSource_Mouse && !g.IO.MouseDown[0])
|
||||
ClearActiveID();
|
||||
else if (g.ActiveIdSource == ImGuiInputSource_Nav && g.NavActivateDownId != id)
|
||||
ClearActiveID();
|
||||
}
|
||||
if (g.ActiveId == id)
|
||||
{
|
||||
if (g.ActiveIdIsJustActivated)
|
||||
{
|
||||
@ -8916,11 +8921,6 @@ bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_s
|
||||
value_changed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearActiveID();
|
||||
}
|
||||
}
|
||||
|
||||
return value_changed;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user