mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-15 08:21:03 -04:00
fractional scaling: another round(!) of rounding fixes
* Ensure buffer sizes are valid. That is, ensure that size / scale * scale == size. * Do size calculation of the window geometry in the same way we calculate the CSD offsets.
This commit is contained in:
parent
753c4b5d4f
commit
1782474481
2 changed files with 73 additions and 66 deletions
|
|
@ -2010,11 +2010,12 @@ wayl_surface_scale_explicit_width_height(
|
|||
LOG_DBG("scaling by a factor of %.2f using fractional scaling "
|
||||
"(width=%d, height=%d) ", scale, width, height);
|
||||
|
||||
xassert((int)roundf(scale * (int)roundf(width / scale)) == width);
|
||||
xassert((int)roundf(scale * (int)roundf(height / scale)) == height);
|
||||
|
||||
wl_surface_set_buffer_scale(surf->surf, 1);
|
||||
wp_viewport_set_destination(
|
||||
surf->viewport,
|
||||
(int32_t)roundf((float)width / scale),
|
||||
(int32_t)roundf((float)height / scale));
|
||||
surf->viewport, roundf(width / scale), roundf(height / scale));
|
||||
#else
|
||||
BUG("wayl_fraction_scaling() returned true, "
|
||||
"but fractional scaling was not available at compile time");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue