kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
* fix #592 (crash on mouse click in TDR window) AttributeError: 'list' object has no attribute 'size' Signed-off-by: Martin <Ho-Ro@users.noreply.github.com> * 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> --------- Signed-off-by: Martin <Ho-Ro@users.noreply.github.com> Co-authored-by: Holger Müller <zarath@gmx.de>pull/602/head
rodzic
7c86009b3e
commit
f996ee9ceb
|
@ -258,7 +258,7 @@ class TDRChart(Chart):
|
|||
return
|
||||
a0.accept()
|
||||
width = self.width() - self.leftMargin - self.rightMargin
|
||||
if self.tdrWindow.td.size:
|
||||
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 self.tdrWindow.td.size:
|
||||
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 not self.tdrWindow.td.size:
|
||||
if not self.tdrWindow.td:
|
||||
return 0
|
||||
width = self.width() - self.leftMargin - self.rightMargin
|
||||
absx = x - self.leftMargin
|
||||
|
|
Ładowanie…
Reference in New Issue