Skip to content

Commit 6ff3c60

Browse files
committed
fix(demo): scope legend bullet to items and label scaling direction
1 parent 5e79712 commit 6ff3c60

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/demo-page.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ export const DEMO_PAGE_HTML = `<!DOCTYPE html>
174174
display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px;
175175
color: var(--text-dim); margin-top: 12px;
176176
}
177-
.legend span::before {
177+
.legend .target::before,
178+
.legend .source::before,
179+
.legend .equal::before {
178180
content: "■"; margin-right: 4px;
179181
}
180182
.legend .target::before { color: var(--accent); }
@@ -491,11 +493,14 @@ function openModalForTile(tile) {
491493
'for display — that downscale is the artifact filter, the same mechanism canon describes for ' +
492494
'"control the character of the loss."';
493495
} else if (binding === 'source') {
496+
const scaleVerb = encodeW < displayWidth ? 'upscaling' : encodeW > displayWidth ? 'downscaling' : 'rendering 1:1';
497+
const scaleClause = encodeW === displayWidth
498+
? 'and your browser is rendering 1:1 at ' + displayWidth + 'px'
499+
: 'and your browser is ' + scaleVerb + ' from ' + encodeW + 'px to ' + displayWidth + 'px for display';
494500
explain =
495501
'Source is small enough that <code>source × 1.5 = ' + encodeW + 'px</code> binds instead of ' +
496-
'target × 1.5. The proxy encoded at the modest overshoot, and your browser is upscaling ' +
497-
'from ' + encodeW + 'px to ' + displayWidth + 'px for display. Without the <code>source × 1.5</code> ' +
498-
'cap, this would have manufactured pixels from no signal.';
502+
'target × 1.5. The proxy encoded at the modest overshoot, ' + scaleClause + '. ' +
503+
'Without the <code>source × 1.5</code> cap, this would have manufactured pixels from no signal.';
499504
} else if (binding === 'equal') {
500505
explain =
501506
'Source dimensions already match the target. No scaling at the encoder; the only work is ' +

0 commit comments

Comments
 (0)