1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-15 00:44:20 +00:00

PlotHistogram, PlotLines: register item ID in a more idiomatic manner. (#7935, #3072)

This commit is contained in:
ocornut 2024-09-03 21:49:35 +02:00
parent f99febfd6f
commit afb15e9795
3 changed files with 8 additions and 1 deletions

View file

@ -8224,7 +8224,7 @@ int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_get
const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding);
const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0));
ItemSize(total_bb, style.FramePadding.y);
if (!ItemAdd(total_bb, 0, &frame_bb))
if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemFlags_NoNav))
return -1;
const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags);