From a522963855d811fa325bd2b8c35c99f30e91325e Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 9 Aug 2026 12:46:01 +0200 Subject: [PATCH] Draw geo overlay for an unresolved-but-selected target too Previously _draw_geo_overlays() only ever looked at placed_entities()/ambiguous_entities(), so a target that failed to resolve entirely (no coord, no potential_coords, e.g. two clues that don't quite geometrically agree) never got its bearing/distance lines drawn no matter what, there was no way to see why on the map itself. Selection is now also a trigger alongside hover/show_geo_desc (matching how firing arrows and blast radius already key off selection), and the candidate list comes from board.reference_points + board.targets directly rather than the resolved-only views, so an unresolved selection still shows its clue geometry. Lets you eyeball whether a bad reading is plain wrong or just off by a bit, bearing readings apparently carry some real-world error margin. --- src/fenigma/grid_widget.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/fenigma/grid_widget.py b/src/fenigma/grid_widget.py index 520944b..b713779 100644 --- a/src/fenigma/grid_widget.py +++ b/src/fenigma/grid_widget.py @@ -528,13 +528,20 @@ class GridCanvas(Gtk.DrawingArea): cr.stroke() def _draw_geo_overlays(self, cr, cell_w, cell_h, grid_h) -> None: - to_show = [] - for category, obj in self.board.placed_entities(): - if obj is self.hovered or obj.show_geo_desc: - to_show.append(obj) - for category, obj in self.board.ambiguous_entities(): - if obj is self.hovered or obj.show_geo_desc: - to_show.append(obj) + """Bearing/distance overlay lines for whatever's hovered, pinned + via show_geo_desc, or currently selected. Selection matters even + for a target that never resolved at all (no coord, no + potential_coords, e.g. two clues that don't quite geometrically + agree), it's not in placed_entities()/ambiguous_entities() either + way, so this looks at every RP/Target directly rather than those, + the only way to let the user eyeball a bad-but-close reading + against what it should have crossed.""" + candidates = list(self.board.reference_points) + list(self.board.targets) + to_show = [ + obj for obj in candidates + if obj.location.clues and not self._excluded_from_map(obj) + and (obj is self.hovered or obj.show_geo_desc or obj is self.selected) + ] for obj in to_show: for clue in obj.location.clues: