mirror of
https://github.com/gwm17/implot.git
synced 2025-01-31 03:18:51 -05:00
extend previous commit based on #50 for vertical lines (e.g. for x-axis)
This commit is contained in:
parent
70f56d8a40
commit
071503b43a
|
@ -1597,6 +1597,10 @@ void EndPlot() {
|
||||||
if (gp.FitX && !ImHasFlag(plot.XAxis.Flags, ImPlotAxisFlags_LockMax) && !NanOrInf(gp.ExtentsX.Max)) {
|
if (gp.FitX && !ImHasFlag(plot.XAxis.Flags, ImPlotAxisFlags_LockMax) && !NanOrInf(gp.ExtentsX.Max)) {
|
||||||
plot.XAxis.Range.Max = 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++) {
|
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)) {
|
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;
|
plot.YAxis[i].Range.Min = gp.ExtentsY[i].Min;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user