diff --git a/src/NanoVNASaver/Charts/TDR.py b/src/NanoVNASaver/Charts/TDR.py index e66b9989..2426ec05 100644 --- a/src/NanoVNASaver/Charts/TDR.py +++ b/src/NanoVNASaver/Charts/TDR.py @@ -394,7 +394,7 @@ def mouseMoveEvent(self, a0: QMouseEvent) -> None: self.update() def _draw_ticks( - self, height, _width, x_step, min_index, qp: QPainter + self, height, _width, _x_step, min_index, qp: QPainter ) -> None: desired_steps = math.ceil( (self.width() - self.leftMargin - self.rightMargin) / 100 @@ -483,7 +483,7 @@ def _draw_max_point( True, ) - def _draw_marker(self, height, x_step, y_step, min_index, qp: QPainter): + def _draw_marker(self, height, _x_step, _y_step, _min_index, qp: QPainter): marker_point = QPoint( self.positionAtLength(self.marker_location, limit=False), (self.topMargin + height), @@ -568,14 +568,14 @@ def _draw_graph(self, height, width, qp: QPainter) -> None: qp.drawLine(last_pt, point) last_pt = point else: - [qp.drawPoint(p) for p in tdr_points if self.isPlotable(p)] + for p in tdr_points: + if self.isPlotable(p): + qp.drawPoint(p) pen.setColor(Chart.color.sweep_secondary) qp.setPen(pen) - [ - qp.drawPoint(p) - for p in step_response_points - if self.isPlotable(p) - ] + for p in step_response_points: + if self.isPlotable(p): + qp.drawPoint(p) self._draw_max_point(height, x_step, y_step, min_index, qp) @@ -736,7 +736,7 @@ def _draw_centered_hanging_text( # Compute top-left position for centered text x = center.x() - text_width // 2 - y = round(center.y() + (-text_height / 4 if above else text_height)) + y = center.y() + (-text_height / 4 if above else text_height) # enhance readability when drawn over ticks margin = 5