Commit 330ed70
fix: apply kitty X=/Y= sub-cell pixel offset to placements (#1646)
* fix: apply kitty X=/Y= sub-cell pixel offset to placements
The kitty graphics protocol lets a placement specify X= and Y= pixel
offsets to "display from a different origin within the cell" (see
"Controlling displayed image layout" in the spec [1]). The wiring for
this was half-finished: KittyPlacement already had cell_x_offset/
cell_y_offset fields and the parser already populated them from X=/Y=,
but nothing connected the two.
Finish the wiring: thread the offset parser -> PlacementRequest ->
KittyPlacement -> render position.
Adds parser tests for the offset and the default.
[1] https://sw.kovidgoyal.net/kitty/graphics-protocol/
* small updates
---------
Co-authored-by: Floens <floens@gmail.com>1 parent 9a2440b commit 330ed70
4 files changed
Lines changed: 248 additions & 7 deletions
File tree
- frontends/rioterm/src/renderer
- rio-backend/src
- ansi
- crosswords
- graphics/kitty
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
442 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
443 | 448 | | |
444 | 449 | | |
445 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
631 | 634 | | |
632 | 635 | | |
633 | 636 | | |
| 637 | + | |
| 638 | + | |
634 | 639 | | |
635 | 640 | | |
636 | 641 | | |
| |||
659 | 664 | | |
660 | 665 | | |
661 | 666 | | |
| 667 | + | |
| 668 | + | |
662 | 669 | | |
663 | 670 | | |
664 | 671 | | |
| |||
1553 | 1560 | | |
1554 | 1561 | | |
1555 | 1562 | | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1556 | 1590 | | |
1557 | 1591 | | |
1558 | 1592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4416 | 4416 | | |
4417 | 4417 | | |
4418 | 4418 | | |
4419 | | - | |
| 4419 | + | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
| 4423 | + | |
| 4424 | + | |
| 4425 | + | |
| 4426 | + | |
| 4427 | + | |
| 4428 | + | |
| 4429 | + | |
| 4430 | + | |
4420 | 4431 | | |
4421 | 4432 | | |
4422 | 4433 | | |
4423 | | - | |
| 4434 | + | |
4424 | 4435 | | |
4425 | 4436 | | |
4426 | 4437 | | |
4427 | 4438 | | |
4428 | | - | |
| 4439 | + | |
4429 | 4440 | | |
4430 | 4441 | | |
4431 | 4442 | | |
| |||
4454 | 4465 | | |
4455 | 4466 | | |
4456 | 4467 | | |
4457 | | - | |
4458 | | - | |
| 4468 | + | |
| 4469 | + | |
4459 | 4470 | | |
4460 | 4471 | | |
4461 | 4472 | | |
| |||
6640 | 6651 | | |
6641 | 6652 | | |
6642 | 6653 | | |
| 6654 | + | |
| 6655 | + | |
6643 | 6656 | | |
6644 | 6657 | | |
6645 | 6658 | | |
| |||
0 commit comments