Skip to content

Commit 5714916

Browse files
committed
Fix clamp in SetupAxisTicks
1 parent 9ef3a97 commit 5714916

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: implot.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,7 @@ void SetupAxisTicks(ImAxis idx, const double* values, int n_ticks, const char* c
21622162
void SetupAxisTicks(ImAxis idx, double v_min, double v_max, int n_ticks, const char* const labels[], bool show_default) {
21632163
IM_ASSERT_USER_ERROR(GImPlot->CurrentPlot != NULL && !GImPlot->CurrentPlot->SetupLocked,
21642164
"Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!");
2165-
n_ticks = ImClamp(n_ticks, 2, n_ticks);
2165+
n_ticks = n_ticks < 2 ? 2 : n_ticks;
21662166
FillRange(GImPlot->TempDouble1, n_ticks, v_min, v_max);
21672167
SetupAxisTicks(idx, GImPlot->TempDouble1.Data, n_ticks, labels, show_default);
21682168
}

0 commit comments

Comments
 (0)