1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-13 14:38:51 -05:00

fix linked axis and auto fitting issue #205

This commit is contained in:
epezent 2021-03-30 16:23:21 -07:00
parent 1d674e7557
commit 27bc59eb43

View File

@ -1414,10 +1414,10 @@ bool BeginPlot(const char* title, const char* x_label, const char* y1_label, con
// Initialization ------------------------------------------------------------
if (!plot.Initialized) {
if (!ImHasFlag(plot.XAxis.Flags,ImPlotAxisFlags_NoInitialFit) && !gp.NextPlotData.HasXRange)
if (!ImHasFlag(plot.XAxis.Flags,ImPlotAxisFlags_NoInitialFit) && !gp.NextPlotData.HasXRange && !gp.NextPlotData.LinkedXmin && !gp.NextPlotData.LinkedXmax)
gp.FitThisFrame = gp.FitX = true;
for (int i = 0; i < IMPLOT_Y_AXES; ++i) {
if (!ImHasFlag(plot.YAxis[i].Flags,ImPlotAxisFlags_NoInitialFit) && !gp.NextPlotData.HasYRange[i])
if (!ImHasFlag(plot.YAxis[i].Flags,ImPlotAxisFlags_NoInitialFit) && !gp.NextPlotData.HasYRange[i] && !gp.NextPlotData.LinkedYmin[i] && !gp.NextPlotData.LinkedYmax[i])
gp.FitThisFrame = gp.FitY[i] = true;
}
}