[mutter/wip/tablet-protocol-v2: 7/65] wayland: Use wl_fixed_t for angle arguments in wp_tablet_tool



commit 5eaf5d738eadd03b4d1a95e980ad4937cfa337ca
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu May 12 15:24:03 2016 +0200

    wayland: Use wl_fixed_t for angle arguments in wp_tablet_tool
    
    This is a change in tablet protocol v2

 src/wayland/meta-wayland-tablet-tool.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index 6aa55ed..2440648 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -42,9 +42,6 @@
 #endif
 
 #define TABLET_AXIS_MAX 65535
-#define DEGREES_PRECISION 100 /* wl_tablet_tool.tilt and .rotation define
-                               * angles in hundreths of a degree
-                               */
 
 static void
 unbind_resource (struct wl_resource *resource)
@@ -739,8 +736,8 @@ broadcast_tilt (MetaWaylandTabletTool *tool,
   wl_resource_for_each (resource, &tool->focus_resource_list)
     {
       zwp_tablet_tool_v2_send_tilt (resource,
-                                    (int32_t) (xtilt * DEGREES_PRECISION),
-                                    (int32_t) (ytilt * DEGREES_PRECISION));
+                                    wl_fixed_from_double (xtilt),
+                                    wl_fixed_from_double (ytilt));
     }
 }
 
@@ -762,7 +759,7 @@ broadcast_rotation (MetaWaylandTabletTool *tool,
   wl_resource_for_each (resource, &tool->focus_resource_list)
     {
       zwp_tablet_tool_v2_send_rotation (resource,
-                                        (int32_t) rotation * DEGREES_PRECISION);
+                                        wl_fixed_from_double (rotation));
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]