Apply suggestions from code review

Looks better, I was too much focused on the "size" and it was all about the emptiness.

Co-authored-by: Holger Müller <zarath@gmx.de>
pull/593/head
Martin 2023-02-01 18:04:11 +01:00 zatwierdzone przez GitHub
rodzic ae23fdd917
commit 79db8d8ef3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -258,7 +258,7 @@ class TDRChart(Chart):
return
a0.accept()
width = self.width() - self.leftMargin - self.rightMargin
if len(self.tdrWindow.td):
if self.tdrWindow.td:
if self.fixedSpan:
max_index = np.searchsorted(
self.tdrWindow.distance_axis, self.maxDisplayLength * 2)
@ -436,7 +436,7 @@ class TDRChart(Chart):
qp.end()
def valueAtPosition(self, y):
if len(self.tdrWindow.td):
if self.tdrWindow.td:
height = self.height() - self.topMargin - self.bottomMargin
absy = (self.height() - y) - self.bottomMargin
if self.fixedValues:
@ -454,7 +454,7 @@ class TDRChart(Chart):
return 0
def lengthAtPosition(self, x, limit=True):
if len(self.tdrWindow.td) == 0:
if not self.tdrWindow.td:
return 0
width = self.width() - self.leftMargin - self.rightMargin
absx = x - self.leftMargin