Increase cursor debounce delay slightly?

fsp_feeds
Tyler Goodlet 2021-07-21 20:02:09 -04:00
parent f06e05c9cb
commit 565380368a
1 changed files with 12 additions and 4 deletions

View File

@ -42,7 +42,7 @@ log = get_logger(__name__)
# latency (in terms of perceived lag in cross hair) so really be sure # latency (in terms of perceived lag in cross hair) so really be sure
# there's an improvement if you want to change it! # there's an improvement if you want to change it!
_mouse_rate_limit = 60 # TODO; should we calc current screen refresh rate? _mouse_rate_limit = 60 # TODO; should we calc current screen refresh rate?
_debounce_delay = 1 / 2e3 _debounce_delay = 1 / 1e3
_ch_label_opac = 1 _ch_label_opac = 1
@ -52,12 +52,15 @@ class LineDot(pg.CurvePoint):
def __init__( def __init__(
self, self,
curve: pg.PlotCurveItem, curve: pg.PlotCurveItem,
index: int, index: int,
plot: 'ChartPlotWidget', # type: ingore # noqa plot: 'ChartPlotWidget', # type: ingore # noqa
pos=None, pos=None,
size: int = 6, # in pxs size: int = 6, # in pxs
color: str = 'default_light', color: str = 'default_light',
) -> None: ) -> None:
pg.CurvePoint.__init__( pg.CurvePoint.__init__(
self, self,
@ -88,7 +91,9 @@ class LineDot(pg.CurvePoint):
def event( def event(
self, self,
ev: QtCore.QEvent, ev: QtCore.QEvent,
) -> None: ) -> None:
if not isinstance( if not isinstance(
ev, QtCore.QDynamicPropertyChangeEvent ev, QtCore.QDynamicPropertyChangeEvent
@ -132,8 +137,8 @@ class ContentsLabel(pg.LabelItem):
} }
def __init__( def __init__(
self, self,
# chart: 'ChartPlotWidget', # noqa # chart: 'ChartPlotWidget', # noqa
view: pg.ViewBox, view: pg.ViewBox,
@ -167,8 +172,8 @@ class ContentsLabel(pg.LabelItem):
self.anchor(itemPos=index, parentPos=index, offset=margins) self.anchor(itemPos=index, parentPos=index, offset=margins)
def update_from_ohlc( def update_from_ohlc(
self, self,
name: str, name: str,
index: int, index: int,
array: np.ndarray, array: np.ndarray,
@ -194,8 +199,8 @@ class ContentsLabel(pg.LabelItem):
) )
def update_from_value( def update_from_value(
self, self,
name: str, name: str,
index: int, index: int,
array: np.ndarray, array: np.ndarray,
@ -239,6 +244,7 @@ class ContentsLabels:
if not (index >= 0 and index < chart._arrays['ohlc'][-1]['index']): if not (index >= 0 and index < chart._arrays['ohlc'][-1]['index']):
# out of range # out of range
print('out of range?')
continue continue
array = chart._arrays[name] array = chart._arrays[name]
@ -278,7 +284,9 @@ class ContentsLabels:
class Cursor(pg.GraphicsObject): class Cursor(pg.GraphicsObject):
'''Multi-plot cursor for use on a ``LinkedSplits`` chart (set).
'''
def __init__( def __init__(
self, self,