Drop the Gain's engraved name and centre its knob (#384)

The plate was taller than its one knob needs, and the engraved
"GAIN" only repeated the node's title. Without it the plate is
square, and the knob sits in its middle.

- The plate is 160x160 instead of 160x220, without the "GAIN"
  engraving.
- The knob is centred on what it shows: the "DB" caption and the
  dial. Since #382 its number hangs inside the dial's open bottom,
  so it adds no height.
- CAPTION_AIR (4) takes out the empty space above the caption's
  capitals. Without it the knob sat a little too low.

Measured on a picture at zoom 0.8: 19 px of air above "DB" and
19 px below the number. The user's screenshot showed about 14
above and 35 below.

Tests:
- Unit hardware-view: 12 tests green. The layout test now asks
  for the same air above and below.
- e2e 34 (melektaus-atx): ALL PASSED, 126 checks.
- Gate (melektaus-atx): CHECK EXIT 0, 283 files, 4359 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-10 13:29:28 +02:00
1 parent 01ee61868b
commit 17f47f6956
4 files changed
+19 -14

No files matched your search

+10 -4
View File
@@ -7,7 +7,9 @@ import { describe, expect, it } from 'vitest';
import {
type Box,
brushStrokes,
CAPTION_AIR,
GAIN_LAYOUT,
KNOB_CAPTION,
GAIN_PANEL,
GAIN_TAPER,
gainReduction,
@@ -140,14 +142,18 @@ describe('the Gain (#384)', () => {
const L = GAIN_LAYOUT;
const knob = knobBox(L.knob);
it('holds its knob inside the plate, clear of the screws and below the title', () => {
it('holds its knob in the middle of the plate, clear of the screws', () => {
expect(knob.x).toBeGreaterThanOrEqual(0);
expect(knob.x + knob.w).toBeLessThanOrEqual(GAIN_PANEL.w);
expect(knob.y + knob.h).toBeLessThanOrEqual(GAIN_PANEL.h);
expect(knob.y).toBeGreaterThanOrEqual(L.title.y + 30);
// Its number hangs inside the dial (#382): from the caption down to the dial's edge is all it shows.
const top = L.knob.y - L.knob.size / 2 - KNOB_CAPTION;
const bottom = L.knob.y + L.knob.size / 2;
expect(top).toBeGreaterThan(0);
expect(top + CAPTION_AIR).toBe(GAIN_PANEL.h - bottom);
expect(knob.x + knob.w / 2).toBe(GAIN_PANEL.w / 2);
const shown = { ...knob, y: top, h: bottom - top };
for (const screw of L.screws)
expect(overlap(knob, { x: screw.x - 7, y: screw.y - 7, w: 14, h: 14 })).toBe(false);
expect(overlap(shown, { x: screw.x - 7, y: screw.y - 7, w: 14, h: 14 })).toBe(false);
});
it('turns 0 dB straight up and the quiet tail by in a fifth of the turn', () => {