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
This commit is contained in:
Georges Basile Stavracas Neto 2020-10-13 08:25:11 -03:00
parent 8809ee9e26
commit d08f724bc3

View File

@ -1294,6 +1294,9 @@ _clutter_actor_transform_local_box_to_stage (ClutterActor *self,
&vertices[v].y, &vertices[v].y,
&z, &z,
&w); &w);
clutter_round_to_256ths (&vertices[v].x);
clutter_round_to_256ths (&vertices[v].y);
} }
return TRUE; return TRUE;