swaywm / swaybg

Wallpaper tool for Wayland compositors
MIT License
490 stars 31 forks source link

Use fractional scale for buffer sizes, using pixel grid assumption #57

Closed mstoeckl closed 1 year ago

mstoeckl commented 1 year ago

This is an alternative to https://github.com/swaywm/swaybg/pull/56. This PR operates under the assumptions that the "logical" and "physical" pixel grids coincide at the (0,0) coordinate, and that the scale value provided by fractional scale exactly provides the ratio between their cell edge sizes. If that is true, you can display a buffer with good pixel alignment by using a fractional wp_viewport source region. Example:

grids