mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Plot: Fixed divide-by-zero in PlotLines() when passing a count of 1. (#2387) [@Lectem]
This commit is contained in:
parent
cf3cb7cf7e
commit
5e3a1de4e6
2 changed files with 3 additions and 1 deletions
|
|
@ -5343,7 +5343,8 @@ void ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_ge
|
|||
|
||||
RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);
|
||||
|
||||
if (values_count > 0)
|
||||
const int values_count_min = (plot_type == ImGuiPlotType_Lines) ? 2 : 1;
|
||||
if (values_count >= 1)//values_count_min)
|
||||
{
|
||||
int res_w = ImMin((int)frame_size.x, values_count) + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
|
||||
int item_count = values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue