From fe622a08b17404d9d9b785a4f821d30835c2eba7 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Sat, 20 Sep 2025 20:05:12 +0400 Subject: [PATCH] fix nolerp line plot leaving a stray vertical line --- src/gui/plot_nolerp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/plot_nolerp.cpp b/src/gui/plot_nolerp.cpp index 0d669afc0..3e96cfc38 100644 --- a/src/gui/plot_nolerp.cpp +++ b/src/gui/plot_nolerp.cpp @@ -135,7 +135,7 @@ int PlotNoLerpEx(ImGuiPlotType plot_type, const char* label, float (*values_gett const ImU32 col_base = ImGui::GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram); const ImU32 col_hovered = ImGui::GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered); - for (int n = 0; n < res_w; n++) + for (int n = 1; n <= res_w; n++) { const float t1 = t0 + t_step; const int v1_idx = (int)(t0 * item_count + 0.5f); @@ -153,7 +153,8 @@ int PlotNoLerpEx(ImGuiPlotType plot_type, const char* label, float (*values_gett if (plot_type == ImGuiPlotType_Lines) { window->DrawList->AddLine(pos0, pos1, idx_hovered == v1_idx ? col_hovered : col_base); - window->DrawList->AddLine(pos2, pos3, idx_hovered == v1_idx ? col_hovered : col_base); + if (n < res_w) + window->DrawList->AddLine(pos2, pos3, idx_hovered == v1_idx ? col_hovered : col_base); } else if (plot_type == ImGuiPlotType_Histogram) {