Wiresheet: keep the half-and-half knob's white centre centred

Pushed into the wire-coloured half, the centre filled almost all of it: that
half is only KNOB_RADIUS wide and the centre is KNOB_CORE_RADIUS, so at the
real 8px knob size the wire colour was reduced to a sliver and the marker read
as plain grey. Centred, both halves keep enough colour to tell apart.

Found on a slot carrying two links on its own sheet plus one leaving it, which
is the only arrangement that produces this knob and did not occur in testSax
until now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-04 19:14:17 +03:00
co-authored by Claude Opus 5
parent e2cd13b9a0
commit e587a111dc
+6 -6
View File
@@ -575,13 +575,13 @@ def draw_knob(x, y, on_sheet, off_sheet, extra_tags=()):
outline="white", width=1, tags=tags) outline="white", width=1, tags=tags)
if on_sheet: if on_sheet:
# A small white centre is what marks the far end as being on this sheet. It # A small white centre is what marks the far end as being on this sheet. It keeps
# keeps its colour through selection, so the middle never fills in -- and on a # its colour through selection, so the middle never fills in. It stays centred
# half-and-half knob it sits in the wire-coloured half it belongs to. # even on a half-and-half knob: pushed into the wire-coloured half it would fill
cx = x - KNOB_RADIUS / 2 if off_sheet else x # that half almost completely and leave no colour to read.
canvas.create_oval( canvas.create_oval(
cx - KNOB_CORE_RADIUS, y - KNOB_CORE_RADIUS, x - KNOB_CORE_RADIUS, y - KNOB_CORE_RADIUS,
cx + KNOB_CORE_RADIUS, y + KNOB_CORE_RADIUS, x + KNOB_CORE_RADIUS, y + KNOB_CORE_RADIUS,
fill="white", outline="", tags=tags + ("link_knob_core",) fill="white", outline="", tags=tags + ("link_knob_core",)
) )