Map: show scout flight's anchor grid square and bearing under its name
This commit is contained in:
parent
d37c109cda
commit
b206b382fc
@ -344,11 +344,20 @@ class GridCanvas(Gtk.DrawingArea):
|
|||||||
continue # hidden means gone from the map, not just darkened, no selection to reinstate it
|
continue # hidden means gone from the map, not just darkened, no selection to reinstate it
|
||||||
self._draw_scout_flight_rect(cr, sf.center, sf.bearing_deg, cell_w, cell_h, grid_h)
|
self._draw_scout_flight_rect(cr, sf.center, sf.bearing_deg, cell_w, cell_h, grid_h)
|
||||||
cx, cy = self._km_to_px(sf.center, cell_w, cell_h, grid_h)
|
cx, cy = self._km_to_px(sf.center, cell_w, cell_h, grid_h)
|
||||||
|
start_coord = solver.point_to_coord(sf.center)
|
||||||
|
grid_name = f"{start_coord.X}{start_coord.Y}" if start_coord is not None else "?"
|
||||||
|
|
||||||
cr.set_font_size(11)
|
cr.set_font_size(11)
|
||||||
cr.set_source_rgba(*LABEL, 1.0)
|
cr.set_source_rgba(*LABEL, 1.0)
|
||||||
cr.move_to(cx + LABEL_PAD, cy - 7)
|
cr.move_to(cx + LABEL_PAD, cy - 7)
|
||||||
cr.show_text(sf.name)
|
cr.show_text(sf.name)
|
||||||
|
|
||||||
|
cr.set_font_size(9)
|
||||||
|
cr.set_source_rgba(*COORD_LABEL, 1.0)
|
||||||
|
cr.move_to(cx + LABEL_PAD, cy + 5)
|
||||||
|
cr.show_text(f"{grid_name} {sf.bearing_deg:05.1f}°")
|
||||||
|
cr.set_font_size(11)
|
||||||
|
|
||||||
def _draw_marker(self, cr, point_km, color, label, cell_w, cell_h, grid_h,
|
def _draw_marker(self, cr, point_km, color, label, cell_w, cell_h, grid_h,
|
||||||
canvas_width, canvas_height, *, hollow=False, dim=False,
|
canvas_width, canvas_height, *, hollow=False, dim=False,
|
||||||
selected=False, coord=None) -> None:
|
selected=False, coord=None) -> None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user