Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backend): add window size api #276

Merged
merged 1 commit into from
Aug 29, 2023
Merged

Commits on Aug 27, 2023

  1. feat(backend): backend provides window_size, add Size struct

    For image (sixel, iTerm2, Kitty...) support that handles graphics in
    terms of `Rect` so that the image area can be included in layouts.
    
    For example: an image is loaded with a known pixel-size, and drawn, but
    the image protocol has no mechanism of knowing the actual cell/character
    area that been drawn on. It is then impossible to skip overdrawing the
    area.
    
    Returning the window size in pixel-width / pixel-height, together with
    colums / rows, it can be possible to account the pixel size of each cell
    / character, and then known the `Rect` of a given image, and also resize
    the image so that it fits exactly in a `Rect`.
    
    Crossterm and termwiz also both return both sizes from one syscall,
    while termion does two.
    
    Add a `Size` struct for the cases where a `Rect`'s `x`/`y` is unused
    (always zero).
    
    `Size` is not "clipped" for `area < u16::max_value()` like `Rect`. This
    is why there are `From` implementations between the two.
    benjajaja committed Aug 27, 2023
    Configuration menu
    Copy the full SHA
    09589b7 View commit details
    Browse the repository at this point in the history