diff --git a/Software/PC_Application/Traces/tracexyplot.cpp b/Software/PC_Application/Traces/tracexyplot.cpp index 0ad2ba8..56f6e75 100644 --- a/Software/PC_Application/Traces/tracexyplot.cpp +++ b/Software/PC_Application/Traces/tracexyplot.cpp @@ -430,15 +430,15 @@ void TraceXYPlot::draw(QPainter &p) if(i == 0) { // only draw tick lines for primary axis if (pref.Graphs.Color.Ticks.Background.enabled) { - int yCoordTop = Util::Scale(YAxis[i].ticks[j], YAxis[i].rangeMax, YAxis[i].rangeMin, plotAreaTop, w.height() - xAxisSpace); - int yCoordBot = Util::Scale(YAxis[i].ticks[j-1], YAxis[i].rangeMax, YAxis[i].rangeMin, plotAreaTop, w.height() - xAxisSpace); - if(yCoordTop > yCoordBot) { - auto buf = yCoordBot; - yCoordBot = yCoordTop; - yCoordTop = buf; - } if (j%2) { + int yCoordTop = Util::Scale(YAxis[i].ticks[j], YAxis[i].rangeMax, YAxis[i].rangeMin, plotAreaTop, w.height() - xAxisSpace); + int yCoordBot = Util::Scale(YAxis[i].ticks[j-1], YAxis[i].rangeMax, YAxis[i].rangeMin, plotAreaTop, w.height() - xAxisSpace); + if(yCoordTop > yCoordBot) { + auto buf = yCoordBot; + yCoordBot = yCoordTop; + yCoordTop = buf; + } p.setBrush(pref.Graphs.Color.Ticks.Background.background); p.setPen(pref.Graphs.Color.Ticks.Background.background); auto rect = QRect(plotAreaLeft+1, yCoordTop+1, plotAreaWidth-2, yCoordBot-yCoordTop-2);