From eee86bdfa99ab7a730c70672c994ad5820fb0857 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 21:53:30 +0000 Subject: [PATCH] fix(crosshair): harden crosshair click scene position handling --- bec_widgets/utils/crosshair.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bec_widgets/utils/crosshair.py b/bec_widgets/utils/crosshair.py index 21e3a77d..0eb54009 100644 --- a/bec_widgets/utils/crosshair.py +++ b/bec_widgets/utils/crosshair.py @@ -493,7 +493,10 @@ class Crosshair(QObject): if event.button() != Qt.MouseButton.LeftButton: return self.update_markers() - scene_pos = event.scenePos() if hasattr(event, "scenePos") else event._scenePos + scene_pos_getter = getattr(event, "scenePos", None) + if not callable(scene_pos_getter): + return + scene_pos = scene_pos_getter() mouse_point = self.plot_item.vb.mapSceneToView(scene_pos) if self._is_within_view_range(mouse_point.x(), mouse_point.y()): x, y = mouse_point.x(), mouse_point.y()