mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-24 00:26:36 +00:00
Slider fix hovering bounding test excluding padding between outer frame and grab
This commit is contained in:
parent
6da83cd5b7
commit
ce8150ce69
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user