1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-10-09 15:47:26 -04:00

extend previous commit based on #50 for vertical lines (e.g. for x-axis)

This commit is contained in:
epezent 2020-09-02 16:09:57 -05:00
parent 70f56d8a40
commit 071503b43a

View File

@ -1597,6 +1597,10 @@ void EndPlot() {
if (gp.FitX && !ImHasFlag(plot.XAxis.Flags, ImPlotAxisFlags_LockMax) && !NanOrInf(gp.ExtentsX.Max)) {
plot.XAxis.Range.Max = gp.ExtentsX.Max;
}
if ((plot.XAxis.Range.Max - plot.XAxis.Range.Min) <= (2.0 * FLT_EPSILON)) {
plot.XAxis.Range.Max += FLT_EPSILON;
plot.XAxis.Range.Min -= FLT_EPSILON;
}
for (int i = 0; i < IMPLOT_Y_AXES; i++) {
if (gp.FitY[i] && !ImHasFlag(plot.YAxis[i].Flags, ImPlotAxisFlags_LockMin) && !NanOrInf(gp.ExtentsY[i].Min)) {
plot.YAxis[i].Range.Min = gp.ExtentsY[i].Min;