mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-17 01:04:19 +00:00
PlotLines, PlotHistogram: Ignore NaN values when calculating min/max bounds. (#2485)
This commit is contained in:
parent
ee02cdbf03
commit
30d81f53cb
2 changed files with 3 additions and 0 deletions
|
|
@ -5577,6 +5577,8 @@ void ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_ge
|
|||
for (int i = 0; i < values_count; i++)
|
||||
{
|
||||
const float v = values_getter(data, i);
|
||||
if (v != v) // Ignore NaN values
|
||||
continue;
|
||||
v_min = ImMin(v_min, v);
|
||||
v_max = ImMax(v_max, v);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue