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.
This commit is contained in:
Dominik Moritz Roth 2026-08-09 12:46:01 +02:00
parent 9295b9bbab
commit a522963855

View File

@ -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: