mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
PlotLines(), PlotHistogram(): fixed incorrect hovering test (would trigger tooltip when menu is open)
This commit is contained in:
parent
1c160adbba
commit
3fa4451936
@ -6572,7 +6572,7 @@ static void Plot(ImGuiPlotType plot_type, const char* label, float (*values_gett
|
||||
|
||||
// Tooltip on hover
|
||||
int v_hovered = -1;
|
||||
if (IsMouseHoveringRect(inner_bb))
|
||||
if (IsHovered(inner_bb, 0))
|
||||
{
|
||||
const float t = ImClamp((g.IO.MousePos.x - inner_bb.Min.x) / (inner_bb.Max.x - inner_bb.Min.x), 0.0f, 0.9999f);
|
||||
const int v_idx = (int)(t * (values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0)));
|
||||
|
Loading…
Reference in New Issue
Block a user