mirror of
https://github.com/gwm17/implot.git
synced 2024-11-26 20:28:50 -05:00
fix linked axis and auto fitting issue #205
This commit is contained in:
parent
1d674e7557
commit
27bc59eb43
|
@ -1414,10 +1414,10 @@ bool BeginPlot(const char* title, const char* x_label, const char* y1_label, con
|
||||||
// Initialization ------------------------------------------------------------
|
// Initialization ------------------------------------------------------------
|
||||||
|
|
||||||
if (!plot.Initialized) {
|
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;
|
gp.FitThisFrame = gp.FitX = true;
|
||||||
for (int i = 0; i < IMPLOT_Y_AXES; ++i) {
|
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;
|
gp.FitThisFrame = gp.FitY[i] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user