1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-23 02:38:53 -05:00

remove adaptive divisions flag, not really used

This commit is contained in:
Evan Pezent 2020-06-13 13:25:38 -05:00
parent 1934bdfd47
commit e2fd883224
2 changed files with 11 additions and 14 deletions

View File

@ -956,17 +956,15 @@ bool BeginPlot(const char* title, const char* x_label, const char* y_label, cons
} }
// adaptive divisions // adaptive divisions
if (HasFlag(plot.XAxis.Flags, ImPlotAxisFlags_Adaptive)) {
plot.XAxis.Divisions = (int)IM_ROUND(0.003 * gp.BB_Canvas.GetWidth()); plot.XAxis.Divisions = (int)IM_ROUND(0.003 * gp.BB_Canvas.GetWidth());
if (plot.XAxis.Divisions < 2) if (plot.XAxis.Divisions < 2)
plot.XAxis.Divisions = 2; plot.XAxis.Divisions = 2;
}
for (int i = 0; i < MAX_Y_AXES; i++) { for (int i = 0; i < MAX_Y_AXES; i++) {
if (HasFlag(plot.YAxis[i].Flags, ImPlotAxisFlags_Adaptive)) {
plot.YAxis[i].Divisions = (int)IM_ROUND(0.003 * gp.BB_Canvas.GetHeight()); plot.YAxis[i].Divisions = (int)IM_ROUND(0.003 * gp.BB_Canvas.GetHeight());
if (plot.YAxis[i].Divisions < 2) if (plot.YAxis[i].Divisions < 2)
plot.YAxis[i].Divisions = 2; plot.YAxis[i].Divisions = 2;
}
} }
// COLORS ----------------------------------------------------------------- // COLORS -----------------------------------------------------------------

View File

@ -60,10 +60,9 @@ enum ImPlotAxisFlags_ {
ImPlotAxisFlags_Invert = 1 << 3, // the axis will be inverted ImPlotAxisFlags_Invert = 1 << 3, // the axis will be inverted
ImPlotAxisFlags_LockMin = 1 << 4, // the axis minimum value will be locked when panning/zooming ImPlotAxisFlags_LockMin = 1 << 4, // the axis minimum value will be locked when panning/zooming
ImPlotAxisFlags_LockMax = 1 << 5, // the axis maximum value will be locked when panning/zooming ImPlotAxisFlags_LockMax = 1 << 5, // the axis maximum value will be locked when panning/zooming
ImPlotAxisFlags_Adaptive = 1 << 6, // grid divisions will adapt to the current pixel size the axis ImPlotAxisFlags_LogScale = 1 << 6, // a logartithmic (base 10) axis scale will be used
ImPlotAxisFlags_LogScale = 1 << 7, // a logartithmic (base 10) axis scale will be used ImPlotAxisFlags_Scientific = 1 << 7, // scientific notation will be used for tick labels if displayed (WIP, not very good yet)
ImPlotAxisFlags_Scientific = 1 << 8, // scientific notation will be used for tick labels if displayed (WIP, not very good yet) ImPlotAxisFlags_Default = ImPlotAxisFlags_GridLines | ImPlotAxisFlags_TickMarks | ImPlotAxisFlags_TickLabels,
ImPlotAxisFlags_Default = ImPlotAxisFlags_GridLines | ImPlotAxisFlags_TickMarks | ImPlotAxisFlags_TickLabels | ImPlotAxisFlags_Adaptive,
ImPlotAxisFlags_Auxiliary = ImPlotAxisFlags_Default & ~ImPlotAxisFlags_GridLines, ImPlotAxisFlags_Auxiliary = ImPlotAxisFlags_Default & ~ImPlotAxisFlags_GridLines,
}; };