[mutter/gbsneto/graphene-frustrum: 31/49] clutter/actor: Round to 256ths when projecting for picking
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/graphene-frustrum: 31/49] clutter/actor: Round to 256ths when projecting for picking
- Date: Fri, 16 Oct 2020 16:37:52 +0000 (UTC)
commit d08f724bc3deece0fa8fc4c86b43603176c3af57
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Oct 13 08:25:11 2020 -0300
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 68290b986d..2e19e24f72 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]