From d602cbc9858e1210367396ebee9934a41cb8b4cc Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 1 Jan 2021 12:59:31 -0500 Subject: [PATCH] Avoid active_plot race --- piker/ui/_graphics/_cursor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piker/ui/_graphics/_cursor.py b/piker/ui/_graphics/_cursor.py index 83f0ee96..d5d4575a 100644 --- a/piker/ui/_graphics/_cursor.py +++ b/piker/ui/_graphics/_cursor.py @@ -31,6 +31,10 @@ from .._style import ( _font, ) from .._axes import YAxisLabel, XAxisLabel +from ...log import get_logger + + +log = get_logger(__name__) # XXX: these settings seem to result in really decent mouse scroll # latency (in terms of perceived lag in cross hair) so really be sure @@ -295,6 +299,7 @@ class CrossHair(pg.GraphicsObject): return cursor def mouseAction(self, action, plot): # noqa + log.debug(f"{(action, plot.name)}") if action == 'Enter': self.active_plot = plot @@ -303,7 +308,6 @@ class CrossHair(pg.GraphicsObject): self.graphics[plot]['yl'].show() else: # Leave - self.active_plot = None # hide horiz line and y-label self.graphics[plot]['hl'].hide()