Skip to content

Commit d49a674

Browse files
thinkingfishclaude
andcommitted
fix(viewer): nudge spectrum checkbox glyph 2px up for visual centering
The ☐/☑ characters carry extra inner whitespace at the bottom of their glyph box, so flex `align-items: center` still leaves them sitting low next to the label baseline. A 2px upward translate on the glyph span compensates and reads as true center alignment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent af374ff commit d49a674

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/viewer/assets/lib/charts/scatter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,14 +448,14 @@ function renderSpectrumCheckbox(el, chart, kind) {
448448
const color = on ? COLORS.fg : COLORS.fgSecondary;
449449
const glyph = on ? '☑' : '☐';
450450
const label = pending ? `${SPECTRUM_LABELS[kind]}…` : SPECTRUM_LABELS[kind];
451-
// Flex centers the 16px glyph against the 13px label baseline so
452-
// they share a vertical midline instead of sitting on a manual
453-
// pixel-nudge that drifts across browsers.
451+
// Flex centers the 16px glyph against the 13px label, then a 2px
452+
// upward translate compensates for the ☐/☑ glyph's built-in
453+
// bottom whitespace so the visual centers actually line up.
454454
el.style.display = 'inline-flex';
455455
el.style.alignItems = 'center';
456456
el.style.gap = '4px';
457457
el.innerHTML =
458-
`<span style="font-size: 16px; line-height: 1;">${glyph}</span><span>${label}</span>`;
458+
`<span style="font-size: 16px; line-height: 1; transform: translateY(-2px);">${glyph}</span><span>${label}</span>`;
459459
el.style.color = color;
460460
}
461461

0 commit comments

Comments
 (0)