Skip to content

Use measured desktop cells for MXP image sizing - #122

Merged
HarryCordewener merged 2 commits into
mainfrom
fix/measured-image-cells
Nov 9, 2026
Merged

HarryCordewener merged 2 commits into
mainfrom
fix/measured-image-cells

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

Why

Avalonia knows its actual cell geometry, but MXP image sizing assumed 8×16 cells. At the default 16px font and line height 1.12, measured cells are 10×24. A square therefore stretched vertically.

Changes

  • Publish immutable measured logical-pixel cell dimensions from TerminalView, initially and after display/font scaling.
  • Use those dimensions for auto sizing, pixel hints and aspect-preserving one-dimensional hints.
  • Keep explicit two-dimensional character-cell boxes as server-specified geometry.
  • Include cell dimensions in rendered-image cache keys; reuse the source image without refetching when dimensions change.
  • Preserve the existing fallback for terminal hosts with unknown metrics.

Fixes #121. This does not fix #119, rebuild already-buffered image blocks, or claim the cause of the particular screenshot.

Checks

  • Release solution build passed, with existing CS8602 in ListEditorTests.cs:191.
  • All seven suites passed: TUI 3,020; Core 1,720; Client 245; Graphics 99; Scripting 92; Web 37; Avalonia 899.
  • Final fallback-preservation adjustment rechecked with the full TUI suite: 3,020 passed.
  • Desktop metric bridge / bundled font tests: 6 passed.
  • MXP geometry tests: 29 passed.

Parallel changes

Independent of zoom and alpha fixes. Zoom uses TerminalView.Rescale, so metric publication follows that path. Alpha PR #120 touches nearby InlineImageHost sizing code; resolve any merge overlap without dropping either payload preservation or cellSize forwarding.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@HarryCordewener
HarryCordewener marked this pull request as ready for review November 9, 2026 00:14
@HarryCordewener
HarryCordewener merged commit e7ca513 into main Nov 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop MXP image sizing assumes the wrong cell aspect ratio Reserved MXP image rows split when surrounding lines wrap

1 participant