Add guard for real-time-not-active last line is `None` case

big_data_lines
Tyler Goodlet 2022-03-06 17:15:43 -05:00
parent 01cc8f347e
commit 7577443f95
1 changed files with 7 additions and 6 deletions

View File

@ -140,8 +140,8 @@ class FastAppendCurve(pg.PlotCurveItem):
# self.last_step_pen = pg.mkPen(hcolor(color), width=2) # self.last_step_pen = pg.mkPen(hcolor(color), width=2)
self.last_step_pen = pg.mkPen(pen, width=2) self.last_step_pen = pg.mkPen(pen, width=2)
self._last_line: QLineF = None self._last_line: Optional[QLineF] = None
self._last_step_rect: QRectF = None self._last_step_rect: Optional[QRectF] = None
# flat-top style histogram-like discrete curve # flat-top style histogram-like discrete curve
self._step_mode: bool = step_mode self._step_mode: bool = step_mode
@ -388,12 +388,13 @@ class FastAppendCurve(pg.PlotCurveItem):
# p.drawPath(self.path) # p.drawPath(self.path)
# profiler('.drawPath()') # profiler('.drawPath()')
p.setPen(self.last_step_pen) if self._last_line:
p.drawLine(self._last_line) p.setPen(self.last_step_pen)
profiler('.drawLine()') p.drawLine(self._last_line)
profiler('.drawLine()')
p.setPen(self.opts['pen'])
# else: # else:
p.setPen(self.opts['pen'])
p.drawPath(self.path) p.drawPath(self.path)
profiler('.drawPath()') profiler('.drawPath()')