diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2023-06-26 18:25:16 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-06-29 13:38:24 +0000 |
| commit | c309c9f572a331881c515d7715d474ef854ea958 (patch) | |
| tree | 26819f31bc8a4add8d2c39c93ace7a39eaf2ebfb | |
| parent | wayland: warn when fractional scaling isn’t available (diff) | |
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.
| -rw-r--r-- | wayland.c | 7 |
1 files changed, 7 insertions, 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); } } |
