From 72b6f74252e1f36339945c549049b166cccf3561 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Tue, 29 Jul 2025 15:46:10 +0200 Subject: [PATCH] fix(crosshair): ignore fetching data and markers from invisible items --- bec_widgets/utils/crosshair.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bec_widgets/utils/crosshair.py b/bec_widgets/utils/crosshair.py index 693655f2..7061f1f0 100644 --- a/bec_widgets/utils/crosshair.py +++ b/bec_widgets/utils/crosshair.py @@ -209,8 +209,11 @@ class Crosshair(QObject): if self.highlighted_curve_index is not None and hasattr(self.plot_item, "visible_curves"): # Focus on the highlighted curve only self.items = [self.plot_item.visible_curves[self.highlighted_curve_index]] - else: - # Handle all curves + elif hasattr(self.plot_item, "visible_items"): # PlotBase general case + # Handle visible items in the plot item + self.items = self.plot_item.visible_items() + else: # Non PlotBase case + # Handle all items self.items = self.plot_item.items # Create or update markers