graphics: a partial x/y/w/h source rectangle is ignored #43

Closed
opened 2026-10-07 09:34:27 +09:00 by natsukium · 0 comments
Owner

felis applies a placement's source rectangle (x, y, w, h) only when all four keys are given (source_rect in crates/felis-daemon/src/graphics.rs). Otherwise the whole image is drawn. A producer that sends, say, only x=40 to skip the left 40 px of a 100 px wide image gets the full image.

kitty: handle_put_command (kitty/graphics.c) defaults each key on its own: x/y default to 0, and an absent or zero w/h means the image size. The resulting width and height are then clipped to what remains of the image past x/y. In the example above kitty draws the right 60 px.

Repro: transmit a 100×50 image and place it with a=p,i=1,x=40. kitty shows the right 60 px; felis shows all 100 px.

Decide: whether to follow kitty's per-key defaults. It changes the SourceRect the daemon stores and sends, and with it the natural extent and the cursor move, which already resolve from the clipped rectangle (felis_grid::images::clip_source).

felis applies a placement's source rectangle (`x`, `y`, `w`, `h`) only when all four keys are given (`source_rect` in `crates/felis-daemon/src/graphics.rs`). Otherwise the whole image is drawn. A producer that sends, say, only `x=40` to skip the left 40 px of a 100 px wide image gets the full image. **kitty:** `handle_put_command` (`kitty/graphics.c`) defaults each key on its own: `x`/`y` default to 0, and an absent or zero `w`/`h` means the image size. The resulting width and height are then clipped to what remains of the image past `x`/`y`. In the example above kitty draws the right 60 px. **Repro:** transmit a 100×50 image and place it with `a=p,i=1,x=40`. kitty shows the right 60 px; felis shows all 100 px. **Decide:** whether to follow kitty's per-key defaults. It changes the `SourceRect` the daemon stores and sends, and with it the natural extent and the cursor move, which already resolve from the clipped rectangle (`felis_grid::images::clip_source`).
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#43
No description provided.