Public Access
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:
1 parent
d2e81a5a36
commit
a4ce97d744
3 files changed
+7
-3
No files matched your search
@@ -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.
|
||||
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;
|
||||
arc(it, cx, y + R, R, -90, 90);
|
||||
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);
|
||||
if (digit != ' ') {
|
||||
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 + 1, y + TH / 2 - 8, f.nixie, TextAlign::CENTER, s);
|
||||
it.end_clipping();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user