Keep the aspect ratio of a one-axis Kitty placement #125

Merged
natsukium merged 1 commit from fix/one-axis-aspect into main 2026-10-12 19:04:25 +09:00
Owner

A placement with only c= or only r= now follows kitty's update_dest_rect: the missing axis is the given axis's pixel span at the image's aspect ratio, in cells, rounded up, and the image draws at that aspect-preserving size. A 101×100 image at r=2 with 10×20 px cells takes 5 columns and draws 40.4×40 px (it used to take 11 and draw 110×40).

  • grid: Extent::Derived, resolved from both requested axes and re-resolved on a cell-size change.
  • wire (unreleased minor 1): ImagePlacement.requested (the c=/r= asked, 0 = automatic), stripped for minor-0 windows; the renderer keeps its old sizing without it.
  • render: draws kitty's destination rectangle and culls on the drawn bounds rather than the daemon's row count.

Closes #42

A placement with only `c=` or only `r=` now follows kitty's `update_dest_rect`: the missing axis is the given axis's pixel span at the image's aspect ratio, in cells, rounded up, and the image draws at that aspect-preserving size. A 101×100 image at `r=2` with 10×20 px cells takes 5 columns and draws 40.4×40 px (it used to take 11 and draw 110×40). - grid: `Extent::Derived`, resolved from both requested axes and re-resolved on a cell-size change. - wire (unreleased minor 1): `ImagePlacement.requested` (the `c=`/`r=` asked, 0 = automatic), stripped for minor-0 windows; the renderer keeps its old sizing without it. - render: draws kitty's destination rectangle and culls on the drawn bounds rather than the daemon's row count. Closes #42
protocol, grid, daemon, client: keep the aspect ratio of a one-axis Kitty placement
All checks were successful
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 8s
darwin / darwin docs-only no-op (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 9s
windows / windows docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 1m8s
windows / cargo nextest (Windows) (pull_request) Successful in 3m44s
windows / frontend smoke (Windows) (pull_request) Successful in 52s
bench / instruction-count regression gate (pull_request) Successful in 43s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m45s
pr / nix flake check (pull_request) Successful in 36s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m55s
pr / wire schema is compatible with the base (pull_request) Successful in 3s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 28s
windows / cargo clippy (Windows cross) (pull_request) Successful in 15s
33b6197497
A put with only c= or only r= resolved the missing axis from the
image's own pixel size, independently of the given one, and the
renderer then stretched the image into that box: a 101x100 image at
r=2 with 10x20 px cells took 11 columns and drew 110x40 px. kitty's
update_dest_rect derives the missing axis from the given one at the
source's aspect ratio (5 columns here), and its renderer draws that
axis at the aspect-preserving pixel size (40.4 px), which no whole
number of cells carries.

The grid's Extent gains a Derived axis, resolved together with the
other axis and re-resolved on a cell-size change like a natural one.
The renderer needs the request, not just the count, so
ImagePlacement.requested carries the c= and r= the put asked for, a
minor-1 field stripped per connection for a minor-0 window like the
virtual placement id; the renderer draws kitty's destination rectangle
from it and keeps its ceil(native) inference only for a daemon that
sends no request.

Closes #42

Assisted-by: Claude Code
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
felis-terminal/felis!125
No description provided.