Internals: DragBehavior: tweaks internals.

This commit is contained in:
omar 2018-04-27 18:22:10 +02:00
parent 1d99b5f963
commit a84aff1875

View File

@ -9063,8 +9063,6 @@ bool ImGui::DragBehavior(const ImRect& frame_bb, ImGuiID id, float* v, float v_s
RenderNavHighlight(frame_bb, id);
RenderFrame(frame_bb.Min, frame_bb.Max, frame_col, true, style.FrameRounding);
bool value_changed = false;
// Process interacting with the drag
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)
ClearActiveID();
}
if (g.ActiveId == id)
{
if (g.ActiveId != id)
return false;
bool value_changed = false;
if (g.ActiveIdIsJustActivated)
{
// 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;
value_changed = true;
}
}
return value_changed;
}