mirror of
https://github.com/ocornut/imgui.git
synced 2025-01-29 19:17:24 +01:00
Plot: Fixed calling with values_count == 0
This commit is contained in:
parent
51111b0ed5
commit
fa73e5aa0e
@ -7080,6 +7080,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);
|
RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);
|
||||||
|
|
||||||
|
if (values_count > 0)
|
||||||
|
{
|
||||||
int res_w = ImMin((int)graph_size.x, values_count) + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
|
int res_w = ImMin((int)graph_size.x, values_count) + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
|
||||||
int item_count = values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
|
int item_count = values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
|
||||||
|
|
||||||
@ -7134,6 +7136,7 @@ void ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_ge
|
|||||||
t0 = t1;
|
t0 = t1;
|
||||||
tp0 = tp1;
|
tp0 = tp1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Text overlay
|
// Text overlay
|
||||||
if (overlay_text)
|
if (overlay_text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user