[mutter/gbsneto/graphene-frustrum: 2/19] clutter/actor: Round to 256ths when projecting for picking




commit c0203435dca6884a8f66cf6c40ce36b33d908cd0
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]