From b18c76642ade7df4ac93623a2fee5b0a9e6c6407 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Sun, 16 Jul 2023 02:36:39 -0700 Subject: [PATCH] scene: apply rounding when translating buffer damage Without a round in this case the damage region is translated to truncated coordinates, potentially misplacing it relative to the actual position of that region in the output buffer. --- types/scene/wlr_scene.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 90d76c16..d840e2de 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -738,8 +738,8 @@ void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buff pixman_region32_fini(&cull_region); pixman_region32_translate(&output_damage, - (lx - scene_output->x) * output_scale, - (ly - scene_output->y) * output_scale); + (int)round((lx - scene_output->x) * output_scale), + (int)round((ly - scene_output->y) * output_scale)); if (wlr_damage_ring_add(&scene_output->damage_ring, &output_damage)) { wlr_output_schedule_frame(scene_output->output); }