Skip to content

Commit b5b796a

Browse files
committed
Skip tick Locators if plot height/width is 0 or negative
1 parent 1ff4b45 commit b5b796a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

implot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ void SetupFinish() {
25592559
// (2) get y tick labels (needed for left/right pad)
25602560
for (int i = 0; i < IMPLOT_NUM_Y_AXES; i++) {
25612561
ImPlotAxis& axis = plot.YAxis(i);
2562-
if (axis.WillRender() && axis.ShowDefaultTicks) {
2562+
if (axis.WillRender() && axis.ShowDefaultTicks && plot_height > 0) {
25632563
axis.Locator(axis.Ticker, axis.Range, plot_height, true, axis.Formatter, axis.FormatterData);
25642564
}
25652565
}
@@ -2572,7 +2572,7 @@ void SetupFinish() {
25722572
// (4) get x ticks
25732573
for (int i = 0; i < IMPLOT_NUM_X_AXES; i++) {
25742574
ImPlotAxis& axis = plot.XAxis(i);
2575-
if (axis.WillRender() && axis.ShowDefaultTicks) {
2575+
if (axis.WillRender() && axis.ShowDefaultTicks && plot_width > 0) {
25762576
axis.Locator(axis.Ticker, axis.Range, plot_width, false, axis.Formatter, axis.FormatterData);
25772577
}
25782578
}

0 commit comments

Comments
 (0)