style(board): hover arrow as slim as the crosshair
public
style(board): hover arrow as slim as the crosshair Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| Changeset | 6e7d3a949184be8eff2db3158f88558a6cb6fd0a |
|---|---|
| Author (claimed) | Timo Stolz <timo.stolz@nullachtvierzehn.de>, |
| Parents | fb734551cbe2 |
| Children | c02631b5642e |
| Pushlog | by timo via ssh by timo via ssh |
modified schach/diagram.py +4 −3
| @@ -376,18 +376,19 @@ class BoardPainter: | ||
| 376 | 376 | x1, y1 = self._square_origin(dst) |
| 377 | 377 | x0, y0, x1, y1 = x0 + sq / 2, y0 + sq / 2, x1 + sq / 2, y1 + sq / 2 |
| 378 | 378 | angle = math.atan2(y1 - y0, x1 - x0) |
| 379 | - head = sq * 0.38 | |
| 379 | + # mit Rand so schlank wie das Visier (Linie 0,07, Rand 0,02), sonst wie bei Lichess | |
| 380 | + shaft, head = (sq * 0.07, sq * 0.28) if outline else (sq * 0.13, sq * 0.38) | |
| 380 | 381 | tip_x, tip_y = x1 - math.cos(angle) * sq * 0.12, y1 - math.sin(angle) * sq * 0.12 |
| 381 | 382 | base_x, base_y = tip_x - math.cos(angle) * head * 0.8, tip_y - math.sin(angle) * head * 0.8 |
| 382 | 383 | start_x, start_y = x0 + math.cos(angle) * sq * 0.2, y0 + math.sin(angle) * sq * 0.2 |
| 383 | - passes = [((0, 0, 0, 0.45), sq * 0.04), ((*rgb, 1.0), 0)] if outline else [((*rgb, 0.8), 0)] | |
| 384 | + passes = [((0, 0, 0, 0.35), sq * 0.02), ((*rgb, 1.0), 0)] if outline else [((*rgb, 0.8), 0)] | |
| 384 | 385 | cr.save() |
| 385 | 386 | cr.set_line_cap(cairo.LINE_CAP_ROUND) |
| 386 | 387 | cr.set_line_join(cairo.LINE_JOIN_ROUND) |
| 387 | 388 | for color, grow in passes: |
| 388 | 389 | cr.set_source_rgba(*color) |
| 389 | 390 | cr.new_path() |
| 390 | - cr.set_line_width(sq * 0.13 + 2 * grow) | |
| 391 | + cr.set_line_width(shaft + 2 * grow) | |
| 391 | 392 | cr.move_to(start_x, start_y) |
| 392 | 393 | cr.line_to(base_x, base_y) |
| 393 | 394 | cr.stroke() |