mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-14 11:07:48 +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
|
// Process clicking on the drag
|
||||||
if (g.ActiveId == id)
|
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)
|
if (g.ActiveIdIsJustActivated)
|
||||||
{
|
{
|
||||||
@ -8916,11 +8921,6 @@ bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_s
|
|||||||
value_changed = true;
|
value_changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ClearActiveID();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return value_changed;
|
return value_changed;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user