diff options
author | Ronan Pigott <ronan@rjp.ie> | 2023-07-16 02:36:39 -0700 |
---|---|---|
committer | Ronan Pigott <ronan@rjp.ie> | 2023-07-16 02:55:09 -0700 |
commit | b18c76642ade7df4ac93623a2fee5b0a9e6c6407 (patch) | |
tree | c033c5179207730e0686036ac8c019f13e0e6bd4 | |
parent | 4de9c9c47f18cafb10b0a8110550e16b61c3093c (diff) |
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.
-rw-r--r-- | types/scene/wlr_scene.c | 4 |
1 files 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); } |