Add `._last_bar_lines` guard to `.paint()`

incremental_update_paths
Tyler Goodlet 2022-05-21 11:45:44 -04:00
parent c256d3bdc0
commit b985b48eb3
1 changed files with 3 additions and 2 deletions

View File

@ -274,8 +274,9 @@ class BarItems(pg.GraphicsObject):
# lead to any perf gains other then when zoomed in to less bars
# in view.
p.setPen(self.last_bar_pen)
p.drawLines(*tuple(filter(bool, self._last_bar_lines)))
profiler('draw last bar')
if self._last_bar_lines:
p.drawLines(*tuple(filter(bool, self._last_bar_lines)))
profiler('draw last bar')
p.setPen(self.bars_pen)
p.drawPath(self.path)