From f4c2b69934e05c4e308256247109b9610a8d085e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 28 Feb 2019 22:50:50 +0100 Subject: [PATCH] stage: Clamp to pixel the redraw clip taking care of the floored coords When we floor the quad coordinates then we've also to enlarge the quad by the difference between the floored value and the actual coordinate, otherwise we'd end up in a smaller quad. https://gitlab.gnome.org/GNOME/mutter/merge_requests/3 --- src/backends/meta-stage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c index f536fc23a..425926a7c 100644 --- a/src/backends/meta-stage.c +++ b/src/backends/meta-stage.c @@ -225,6 +225,11 @@ queue_redraw_clutter_rect (MetaStage *stage, .height = ceilf (rect->size.height) }; + /* Since we're flooring the coordinates, we need to enlarge the clip by the + * difference between the actual coordinate and the floored value */ + clip.width += ceilf (rect->origin.x - clip.x) * 2; + clip.height += ceilf (rect->origin.y - clip.y) * 2; + clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stage), &clip); }