mirror of
https://github.com/Drezil/imgui.git
synced 2025-04-01 17:02:45 +00:00
Internals: DragBehavior: tweaks internals.
This commit is contained in:
parent
1d99b5f963
commit
a84aff1875
@ -9063,8 +9063,6 @@ bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_s
|
|||||||
RenderNavHighlight(frame_bb, id);
|
RenderNavHighlight(frame_bb, id);
|
||||||
RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding);
|
RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding);
|
||||||
|
|
||||||
bool value_changed = false;
|
|
||||||
|
|
||||||
// Process interacting with the drag
|
// Process interacting with the drag
|
||||||
if (g.ActiveId == id)
|
if (g.ActiveId == id)
|
||||||
{
|
{
|
||||||
@ -9073,8 +9071,10 @@ bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_s
|
|||||||
else if (g.ActiveIdSource == ImGuiInputSource_Nav && g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated)
|
else if (g.ActiveIdSource == ImGuiInputSource_Nav && g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated)
|
||||||
ClearActiveID();
|
ClearActiveID();
|
||||||
}
|
}
|
||||||
if (g.ActiveId == id)
|
if (g.ActiveId != id)
|
||||||
{
|
return false;
|
||||||
|
|
||||||
|
bool value_changed = false;
|
||||||
if (g.ActiveIdIsJustActivated)
|
if (g.ActiveIdIsJustActivated)
|
||||||
{
|
{
|
||||||
// Lock current value on click
|
// Lock current value on click
|
||||||
@ -9136,7 +9136,6 @@ bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_s
|
|||||||
*v = v_cur;
|
*v = v_cur;
|
||||||
value_changed = true;
|
value_changed = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return value_changed;
|
return value_changed;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user