From ce8150ce6969aec0d85b74bfb52ad3f6ee1f1e80 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 15 Mar 2015 01:36:29 +0000 Subject: [PATCH] Slider fix hovering bounding test excluding padding between outer frame and grab --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 5dbc408a..dbc7b251 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4887,13 +4887,13 @@ bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, c const ImGuiAabb bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f)); // NB- we don't call ItemSize() yet becausae we may turn into a text edit box below - if (!ItemAdd(slider_bb, &id)) + if (!ItemAdd(frame_bb, &id)) { ItemSize(bb); return false; } - const bool hovered = IsHovered(slider_bb, id); + const bool hovered = IsHovered(frame_bb, id); if (hovered) g.HoveredId = id;