1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-26 20:28:50 -05:00

make time override log

This commit is contained in:
epezent 2020-09-04 13:28:55 -05:00
parent 8d74440765
commit c70eee5701

View File

@ -917,10 +917,10 @@ bool BeginPlot(const char* title, const char* x_label, const char* y_label, cons
// (4) get x ticks // (4) get x ticks
if (gp.RenderX && gp.NextPlotData.ShowDefaultTicksX) { if (gp.RenderX && gp.NextPlotData.ShowDefaultTicksX) {
if (gp.X.IsTime)
AddTicksTime(plot.XAxis.Range, plot_width, gp.XTicks);
if (ImHasFlag(plot.XAxis.Flags, ImPlotAxisFlags_LogScale)) if (ImHasFlag(plot.XAxis.Flags, ImPlotAxisFlags_LogScale))
AddTicksLogarithmic(plot.XAxis.Range, (int)IM_ROUND(plot_width * 0.01f), gp.XTicks); AddTicksLogarithmic(plot.XAxis.Range, (int)IM_ROUND(plot_width * 0.01f), gp.XTicks);
else if (gp.X.IsTime)
AddTicksTime(plot.XAxis.Range, plot_width, gp.XTicks);
else else
AddTicksDefault(plot.XAxis.Range, ImMax(2, (int)IM_ROUND(0.0025 * plot_width)), IMPLOT_SUB_DIV, gp.XTicks); AddTicksDefault(plot.XAxis.Range, ImMax(2, (int)IM_ROUND(0.0025 * plot_width)), IMPLOT_SUB_DIV, gp.XTicks);
} }