Public repository: timo / schach

Reader

Ein aufgeräumtes Schach-Programm für GNOME

fix(board): draw square tags above course shapes

public

fix(board): draw square tags above course shapes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changeset0c383647c00cae741ddd7528172d1072b2303df5
Author (claimed)Timo Stolz <timo.stolz@nullachtvierzehn.de>,
Parents72385b734fb5
Children11fdf5078ebc
Pushlog
by timo via ssh
by timo via ssh

modified schach/diagram.py +5 −4

@@ -299,16 +299,17 @@ class BoardPainter:
299299
             hops = [s for s in (self.spotlight_from, self.spotlight_via) if s is not None] + [self.spotlight]
300300
             for a, b in zip(hops, hops[1:]):
301301
                 self._draw_arrow(cr, a, b, sq, SPOTLIGHT, outline=True)
302
-            for i in range(1, len(hops)):  # Ziel und Zwischenfeld bekommen ein Schild, jedes neben seinen Pfeilen
303
-                self._square_tag(cr, hops[i], sq, SPOTLIGHT, hops[i - 1:i] + hops[i + 1:i + 2])
304
-            if len(hops) == 1:
305
-                self._square_tag(cr, self.spotlight, sq, SPOTLIGHT)
306302
         for tail, head, color in self.shapes:
307303
             rgb = SHAPE_COLORS.get(color, SHAPE_COLORS["green"])
308304
             if tail == head:
309305
                 self._ring(cr, tail, sq, rgb)
310306
             else:
311307
                 self._draw_arrow(cr, tail, head, sq, rgb)
308
+        if self.spotlight is not None:  # Schilder zuletzt: über Kurskreisen und -pfeilen lesbar
309
+            for i in range(1, len(hops)):  # Ziel und Zwischenfeld bekommen ein Schild, jedes neben seinen Pfeilen
310
+                self._square_tag(cr, hops[i], sq, SPOTLIGHT, hops[i - 1:i] + hops[i + 1:i + 2])
311
+            if len(hops) == 1:
312
+                self._square_tag(cr, self.spotlight, sq, SPOTLIGHT)
312313
 
313314
         if self.strips:
314315
             if not self.editing: