Nav, Focus: Changed SetKeyboardFocusHere() to not behave if a drag or window moving is in progress + move KeepAliveID() call from Scrollbar() to ScrollbarEx()

This commit is contained in:
ocornut
2022-06-15 14:55:45 +02:00
parent ddcff10343
commit 27343efb0b
3 changed files with 14 additions and 2 deletions

View File

@ -880,9 +880,7 @@ void ImGui::Scrollbar(ImGuiAxis axis)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
const ImGuiID id = GetWindowScrollbarID(window, axis);
KeepAliveID(id);
// Calculate scrollbar bounding box
ImRect bb = GetWindowScrollbarRect(window, axis);
@ -920,6 +918,8 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6
if (window->SkipItems)
return false;
KeepAliveID(id);
const float bb_frame_width = bb_frame.GetWidth();
const float bb_frame_height = bb_frame.GetHeight();
if (bb_frame_width <= 0.0f || bb_frame_height <= 0.0f)