aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/wayland.c b/wayland.c
index a87bf45d..34050d18 100644
--- a/wayland.c
+++ b/wayland.c
@@ -2024,10 +2024,19 @@ surface_scale_explicit_width_height(
"(width=%d, height=%d)", scale, width, height);
xassert(scale == floorf(scale));
-
const int iscale = (int)floorf(scale);
- xassert(width % iscale == 0);
- xassert(height % iscale == 0);
+
+ if (verify) {
+ if (width % iscale != 0) {
+ BUG("width=%d is not valid with scaling factor %.2f (%d %% %d != 0)",
+ width, scale, width, iscale);
+ }
+
+ if (height % iscale != 0) {
+ BUG("height=%d is not valid with scaling factor %.2f (%d %% %d != 0)",
+ height, scale, height, iscale);
+ }
+ }
wl_surface_set_buffer_scale(surf->surf, iscale);
}