From f9f4fdca7e9aa7c97e89766bb5dcf845509a4cb8 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 21 Jul 2021 20:02:09 -0400 Subject: [PATCH] Increase cursor debounce delay slightly? --- piker/ui/_cursor.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/piker/ui/_cursor.py b/piker/ui/_cursor.py index 8a74ffc7..7415005a 100644 --- a/piker/ui/_cursor.py +++ b/piker/ui/_cursor.py @@ -42,7 +42,7 @@ log = get_logger(__name__) # latency (in terms of perceived lag in cross hair) so really be sure # there's an improvement if you want to change it! _mouse_rate_limit = 60 # TODO; should we calc current screen refresh rate? -_debounce_delay = 1 / 2e3 +_debounce_delay = 1 / 1e3 _ch_label_opac = 1 @@ -52,12 +52,15 @@ class LineDot(pg.CurvePoint): def __init__( self, + curve: pg.PlotCurveItem, index: int, + plot: 'ChartPlotWidget', # type: ingore # noqa pos=None, size: int = 6, # in pxs color: str = 'default_light', + ) -> None: pg.CurvePoint.__init__( self, @@ -88,7 +91,9 @@ class LineDot(pg.CurvePoint): def event( self, + ev: QtCore.QEvent, + ) -> None: if not isinstance( ev, QtCore.QDynamicPropertyChangeEvent @@ -132,8 +137,8 @@ class ContentsLabel(pg.LabelItem): } def __init__( - self, + # chart: 'ChartPlotWidget', # noqa view: pg.ViewBox, @@ -167,8 +172,8 @@ class ContentsLabel(pg.LabelItem): self.anchor(itemPos=index, parentPos=index, offset=margins) def update_from_ohlc( - self, + name: str, index: int, array: np.ndarray, @@ -194,8 +199,8 @@ class ContentsLabel(pg.LabelItem): ) def update_from_value( - self, + name: str, index: int, array: np.ndarray, @@ -239,6 +244,7 @@ class ContentsLabels: if not (index >= 0 and index < chart._arrays['ohlc'][-1]['index']): # out of range + print('out of range?') continue array = chart._arrays[name] @@ -278,7 +284,9 @@ class ContentsLabels: class Cursor(pg.GraphicsObject): + '''Multi-plot cursor for use on a ``LinkedSplits`` chart (set). + ''' def __init__( self,