diff --git a/piker/ui/_curve.py b/piker/ui/_curve.py index 052a94a3..091bbad0 100644 --- a/piker/ui/_curve.py +++ b/piker/ui/_curve.py @@ -163,6 +163,16 @@ class FlowGraphic(pg.GraphicsObject): return None + @cm + def reset_cache(self) -> None: + self.setCacheMode(QtWidgets.QGraphicsItem.NoCache) + try: + log.debug(f'{self._name} -> CACHE DISABLE') + yield + finally: + log.debug(f'{self._name} -> CACHE ENABLE') + self.setCacheMode(self.cache_mode) + class Curve(FlowGraphic): ''' @@ -251,12 +261,6 @@ class Curve(FlowGraphic): self.fast_path.clear() # self.fast_path = None - @cm - def reset_cache(self) -> None: - self.setCacheMode(QtWidgets.QGraphicsItem.NoCache) - yield - self.setCacheMode(QGraphicsItem.DeviceCoordinateCache) - def boundingRect(self): ''' Compute and then cache our rect. diff --git a/piker/ui/_ohlc.py b/piker/ui/_ohlc.py index 25ebb591..f3eb12b0 100644 --- a/piker/ui/_ohlc.py +++ b/piker/ui/_ohlc.py @@ -93,7 +93,7 @@ class BarItems(FlowGraphic): ''' # XXX: causes this weird jitter bug when click-drag panning # where the path curve will awkwardly flicker back and forth? - cache_mode: int = QGraphicsItem.NoCache + # cache_mode: int = QGraphicsItem.NoCache def __init__( self,