From fde6707c9c70dde41cb6f8deb2f555ddee5e88dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Sun, 18 May 2025 13:36:44 +0200 Subject: [PATCH] show trace names for traces which are only on secondary Y axis --- .../PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp index 0f374ae..4b8f2c3 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/tracexyplot.cpp @@ -1040,8 +1040,14 @@ void TraceXYPlot::enableTraceAxis(Trace *t, int axis, bool enabled) // unable to add trace to the requested axis return; } - if(axis == 0) { - TracePlot::enableTrace(t, enabled); + if(enabled) { + TracePlot::enableTrace(t, true); + } else { + // only disable trace on parent trace list if disabled for both axes + int otherAxis = axis ? 0 : 1; + if(tracesAxis[otherAxis].find(t) == tracesAxis[otherAxis].end()) { + TracePlot::enableTrace(t, false); + } } bool alreadyEnabled = tracesAxis[axis].find(t) != tracesAxis[axis].end(); if(alreadyEnabled != enabled) {