From 1a10514cade595e0b1d06dc8849ad85cbbe556a2 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 19 Jan 2023 11:42:13 -0500 Subject: [PATCH] Disable coordinate caching on OHLC ds curves to avoid smearing --- piker/ui/_curve.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piker/ui/_curve.py b/piker/ui/_curve.py index a3287341..f4dba90b 100644 --- a/piker/ui/_curve.py +++ b/piker/ui/_curve.py @@ -112,6 +112,7 @@ class Curve(FlowGraphic): updates don't trigger a full path redraw. ''' + cache_mode: int = QGraphicsItem.DeviceCoordinateCache def __init__( self, @@ -178,7 +179,7 @@ class Curve(FlowGraphic): # only thing drawn is the "last" line segment which can # have a weird artifact where it won't be fully drawn to its # endpoint (something we saw on trade rate curves) - self.setCacheMode(QGraphicsItem.DeviceCoordinateCache) + self.setCacheMode(self.cache_mode) # XXX-NOTE-XXX: graphics caching. # see explanation for different caching modes: @@ -382,6 +383,9 @@ class Curve(FlowGraphic): # (via it's max / min) even when highly zoomed out. class FlattenedOHLC(Curve): + # avoids strange dragging/smearing artifacts when panning.. + cache_mode: int = QGraphicsItem.NoCache + def draw_last_datum( self, path: QPainterPath,