Divergence meter: keep digits inside the tubes, close the domes

The tube was 56 px wide while its dome (radius 28) spans 57, so the dome
overshot the right wall by a pixel; tubes are now 57 px. The Nixie digits
at size 110 were up to 60 px wide (plus the 1 px glow) in a 55 px tube;
size 90 fits, and each digit is clipped to the inside of its glass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-19 17:57:22 +02:00
1 parent d2e81a5a36
commit a4ce97d744
3 files changed
+7 -3

No files matched your search

+6 -2
View File
@@ -98,7 +98,8 @@ constexpr int WORLD_LINE_COUNT = sizeof(WORLD_LINES) / sizeof(WORLD_LINES[0]);
// One Nixie tube: glass outline, anode mesh, socket, and the lit digit. // One Nixie tube: glass outline, anode mesh, socket, and the lit digit.
void tube(Display &it, const Fonts &f, int x, int y, char digit) { void tube(Display &it, const Fonts &f, int x, int y, char digit) {
constexpr int TW = 56, TH = 176, R = 28; // Odd width so the dome (radius R, 2R + 1 pixels across) meets both walls.
constexpr int TW = 57, TH = 176, R = 28;
const int cx = x + TW / 2; const int cx = x + TW / 2;
arc(it, cx, y + R, R, -90, 90); arc(it, cx, y + R, R, -90, 90);
it.vertical_line(x, y + R, TH - R - 14); it.vertical_line(x, y + R, TH - R - 14);
@@ -111,9 +112,12 @@ void tube(Display &it, const Fonts &f, int x, int y, char digit) {
it.draw_pixel_at(mx, my); it.draw_pixel_at(mx, my);
if (digit != ' ') { if (digit != ' ') {
const char s[2] = {digit, 0}; const char s[2] = {digit, 0};
// Twice, one pixel apart, so the thin filament reads as glowing. // Twice, one pixel apart, so the thin filament reads as glowing; kept
// inside the glass.
it.start_clipping(x + 2, y + 2, x + TW - 2, y + TH - 14);
it.print(cx, y + TH / 2 - 8, f.nixie, TextAlign::CENTER, s); it.print(cx, y + TH / 2 - 8, f.nixie, TextAlign::CENTER, s);
it.print(cx + 1, y + TH / 2 - 8, f.nixie, TextAlign::CENTER, s); it.print(cx + 1, y + TH / 2 - 8, f.nixie, TextAlign::CENTER, s);
it.end_clipping();
} }
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

+1 -1
View File
@@ -207,7 +207,7 @@ font:
# Steins;Gate pages (also use f_cp_mono, f_cp_code and f_ks_pixel) # Steins;Gate pages (also use f_cp_mono, f_cp_code and f_ks_pixel)
- file: "gfonts://Nixie One" - file: "gfonts://Nixie One"
id: f_sg_nixie id: f_sg_nixie
size: 110 size: 90
glyphs: "0123456789." glyphs: "0123456789."
- file: "gfonts://Special Elite" - file: "gfonts://Special Elite"
id: f_sg_title id: f_sg_title