render: a natural-size image placement rescales when the cell size changes #19

Closed
opened 2026-10-02 23:40:56 +09:00 by natsukium · 0 comments
Owner

For a placement without c=/r=, the daemon resolves the natural cell extent once, with the cell size at placement time (resolve_natural_cells, crates/felis-daemon/src/graphics.rs ~1296), and sends those cols/rows to the client. When the cell size later changes, quad_for_placement (crates/felis-render-wgpu/src/lib.rs ~1883) no longer finds cols == ceil(px / cell) and scales the image into cols × cw by rows × ch. With no mipmaps, a downscale aliases visibly. kitty recomputes the extent of such placements against the new cell size (grman_rescale), so they stay at native pixels.

Every cell-size change triggers it: the font_size zoom chords, a config font change, a scale-factor change, or windows with different cell sizes viewing one session.

Repro: with 7×18 cells, timg -pk image.png (806×426 drawn at native size), then ctrl+shift+-: the cell becomes 7×17 and the image is squashed to 408 px tall with jagged text. ctrl+shift+= (8×19) stretches it to ~928 px wide.

The same applies to Unicode-placeholder virtual placements whose extent is resolved naturally (placeholder_grid_extent).

For a placement without `c=`/`r=`, the daemon resolves the natural cell extent once, with the cell size at placement time (`resolve_natural_cells`, `crates/felis-daemon/src/graphics.rs` ~1296), and sends those `cols`/`rows` to the client. When the cell size later changes, `quad_for_placement` (`crates/felis-render-wgpu/src/lib.rs` ~1883) no longer finds `cols == ceil(px / cell)` and scales the image into `cols × cw` by `rows × ch`. With no mipmaps, a downscale aliases visibly. kitty recomputes the extent of such placements against the new cell size (`grman_rescale`), so they stay at native pixels. Every cell-size change triggers it: the `font_size` zoom chords, a config font change, a scale-factor change, or windows with different cell sizes viewing one session. **Repro:** with 7×18 cells, `timg -pk image.png` (806×426 drawn at native size), then `ctrl+shift+-`: the cell becomes 7×17 and the image is squashed to 408 px tall with jagged text. `ctrl+shift+=` (8×19) stretches it to ~928 px wide. The same applies to Unicode-placeholder virtual placements whose extent is resolved naturally (`placeholder_grid_extent`).
Sign in to join this conversation.
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#19
No description provided.