Skip to content

Commit

Permalink
Fixed floating-point precision issue making the right-side value of a…
Browse files Browse the repository at this point in the history
… plot sometimes wrap to the left-side value.
  • Loading branch information
ocornut committed Aug 15, 2014
1 parent ade21a1 commit f5dbb0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
- combo: turn child handling code into popup helper
- list selection, concept of a selectable "block" (that can be multiple widgets)
- menubar, menus
- plot: plot lines draws 1 item too much?
- 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)
- file selection widget -> build the tool in our codebase to improve model-dialog idioms (may or not lead to ImGui changes)
- slider: allow using the [-]/[+] buttons used by InputFloat()/InputInt()
Expand Down Expand Up @@ -3400,7 +3399,7 @@ static void Plot(ImGuiPlotType plot_type, const char* label, const float* values
const ImU32 col_base = window->Color((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram);
const ImU32 col_hovered = window->Color((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered);

while (t0 < 1.0f)
for (int n = 0; n < res_w; n++)
{
const float t1 = t0 + t_step;
const int v_idx = (int)(t0 * values_count);
Expand Down

0 comments on commit f5dbb0a

Please sign in to comment.