Skip to content

Commit f5dbb0a

Browse files
committed
Fixed floating-point precision issue making the right-side value of a plot sometimes wrap to the left-side value.
1 parent ade21a1 commit f5dbb0a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: imgui.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
- combo: turn child handling code into popup helper
132132
- list selection, concept of a selectable "block" (that can be multiple widgets)
133133
- menubar, menus
134-
- plot: plot lines draws 1 item too much?
135134
- plot: add a helper e.g. Plot(char* label, float value, float time_span=2.0f) that stores values and Plot them for you - probably another function name. and/or automatically allow to plot ANY displayed value (more reliance on stable ID)
136135
- file selection widget -> build the tool in our codebase to improve model-dialog idioms (may or not lead to ImGui changes)
137136
- slider: allow using the [-]/[+] buttons used by InputFloat()/InputInt()
@@ -3400,7 +3399,7 @@ static void Plot(ImGuiPlotType plot_type, const char* label, const float* values
34003399
const ImU32 col_base = window->Color((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram);
34013400
const ImU32 col_hovered = window->Color((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered);
34023401

3403-
while (t0 < 1.0f)
3402+
for (int n = 0; n < res_w; n++)
34043403
{
34053404
const float t1 = t0 + t_step;
34063405
const int v_idx = (int)(t0 * values_count);

0 commit comments

Comments
 (0)