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>
| Changeset | 0c383647c00cae741ddd7528172d1072b2303df5 |
|---|---|
| Author (claimed) | Timo Stolz <timo.stolz@nullachtvierzehn.de>, |
| Parents | 72385b734fb5 |
| Children | 11fdf5078ebc |
| Pushlog | by timo via ssh by timo via ssh |
modified schach/diagram.py +5 −4
| @@ -299,16 +299,17 @@ class BoardPainter: | ||
| 299 | 299 | hops = [s for s in (self.spotlight_from, self.spotlight_via) if s is not None] + [self.spotlight] |
| 300 | 300 | for a, b in zip(hops, hops[1:]): |
| 301 | 301 | 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) | |
| 306 | 302 | for tail, head, color in self.shapes: |
| 307 | 303 | rgb = SHAPE_COLORS.get(color, SHAPE_COLORS["green"]) |
| 308 | 304 | if tail == head: |
| 309 | 305 | self._ring(cr, tail, sq, rgb) |
| 310 | 306 | else: |
| 311 | 307 | 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) | |
| 312 | 313 | |
| 313 | 314 | if self.strips: |
| 314 | 315 | if not self.editing: |