From d08f724bc3deece0fa8fc4c86b43603176c3af57 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Tue, 13 Oct 2020 08:25:11 -0300 Subject: [PATCH] clutter/actor: Round to 256ths when projecting for picking Picking is specially sensitive for float precision, and tests can easily fail when something changes, even if ever so slightly. A simple way to workaround this is by adjusting the projected points using the same procedure described at 67cc60cbda. Round projected points for picking to 256ths. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489 --- clutter/clutter/clutter-actor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 68290b986..2e19e24f7 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -1294,6 +1294,9 @@ _clutter_actor_transform_local_box_to_stage (ClutterActor *self, &vertices[v].y, &z, &w); + + clutter_round_to_256ths (&vertices[v].x); + clutter_round_to_256ths (&vertices[v].y); } return TRUE;