From 57149164d532df9c4383cf96e5d2ab7f0f93b7ca Mon Sep 17 00:00:00 2001 From: Evan Pezent Date: Sat, 17 Sep 2022 10:25:30 -0500 Subject: [PATCH] Fix clamp in SetupAxisTicks --- implot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implot.cpp b/implot.cpp index a37b49c..c5cb79b 100644 --- a/implot.cpp +++ b/implot.cpp @@ -2162,7 +2162,7 @@ void SetupAxisTicks(ImAxis idx, const double* values, int n_ticks, const char* c void SetupAxisTicks(ImAxis idx, double v_min, double v_max, int n_ticks, const char* const labels[], bool show_default) { IM_ASSERT_USER_ERROR(GImPlot->CurrentPlot != NULL && !GImPlot->CurrentPlot->SetupLocked, "Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!"); - n_ticks = ImClamp(n_ticks, 2, n_ticks); + n_ticks = n_ticks < 2 ? 2 : n_ticks; FillRange(GImPlot->TempDouble1, n_ticks, v_min, v_max); SetupAxisTicks(idx, GImPlot->TempDouble1.Data, n_ticks, labels, show_default); }