mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-25 21:17:01 +00:00
PlotLines, PlotHistogram: Ignore NaN values when calculating min/max bounds. (#2485)
This commit is contained in:
parent
ee02cdbf03
commit
30d81f53cb
@ -49,6 +49,7 @@ Other Changes:
|
|||||||
- GetMouseDragDelta(): also returns the delta on the mouse button released frame. (#2419)
|
- GetMouseDragDelta(): also returns the delta on the mouse button released frame. (#2419)
|
||||||
- GetMouseDragDelta(): verify that mouse positions are valid otherwise returns zero.
|
- GetMouseDragDelta(): verify that mouse positions are valid otherwise returns zero.
|
||||||
- Inputs: Also add support for horizontal scroll with Shift+Mouse Wheel. (#2424, #1463) [@LucaRood]
|
- Inputs: Also add support for horizontal scroll with Shift+Mouse Wheel. (#2424, #1463) [@LucaRood]
|
||||||
|
- PlotLines, PlotHistogram: Ignore NaN values when calculating min/max bounds. (#2485)
|
||||||
- Misc: Added IM_MALLOC/IM_FREE macros mimicking IM_NEW/IM_DELETE so user doesn't need to revert
|
- Misc: Added IM_MALLOC/IM_FREE macros mimicking IM_NEW/IM_DELETE so user doesn't need to revert
|
||||||
to using the ImGui::MemAlloc()/MemFree() calls directly.
|
to using the ImGui::MemAlloc()/MemFree() calls directly.
|
||||||
- Examples: OpenGL: Added a dummy GL call + comments in ImGui_ImplOpenGL3_Init() to detect uninitialized
|
- Examples: OpenGL: Added a dummy GL call + comments in ImGui_ImplOpenGL3_Init() to detect uninitialized
|
||||||
|
@ -5577,6 +5577,8 @@ void ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_ge
|
|||||||
for (int i = 0; i < values_count; i++)
|
for (int i = 0; i < values_count; i++)
|
||||||
{
|
{
|
||||||
const float v = values_getter(data, i);
|
const float v = values_getter(data, i);
|
||||||
|
if (v != v) // Ignore NaN values
|
||||||
|
continue;
|
||||||
v_min = ImMin(v_min, v);
|
v_min = ImMin(v_min, v);
|
||||||
v_max = ImMax(v_max, v);
|
v_max = ImMax(v_max, v);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user