mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
wayland: surface_scale(): assert surface width/height is a multiple of scale
When doing legacy scaling (non-fractional scaling), assert the surface’s width and height are multiples of the (integer) scale.
This commit is contained in:
parent
8a4efb3427
commit
c309c9f572
1 changed files with 7 additions and 0 deletions
|
|
@ -1908,6 +1908,13 @@ wayl_surface_scale_explicit_width_height(
|
|||
#endif
|
||||
} else {
|
||||
LOG_DBG("scaling by a factor of %.2f (legacy)", scale);
|
||||
|
||||
xassert(scale == floor(scale));
|
||||
|
||||
const int iscale = (int)scale;
|
||||
xassert(width % iscale == 0);
|
||||
xassert(height % iscale == 0);
|
||||
|
||||
wl_surface_set_buffer_scale(surf->surf, (int)scale);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue