[PATCH weston] Use wl_fixed_to_int() in weston_output_update_zoom().

Scott Moreau oreaus at gmail.com
Tue May 15 16:18:33 PDT 2012


This way, we don't have to use wl_fixed_to_int() for
each call to weston_output_update_zoom(). The instance
in notify_motion() was missed, which broke zoom.
---
 src/compositor.c |    3 +++
 src/shell.c      |    4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 788b1de..e5d89b5 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2363,6 +2363,9 @@ weston_output_update_zoom(struct weston_output *output, int x, int y)
 	if (output->zoom.level <= 0)
 		return;
 
+	x = wl_fixed_to_int(x);
+	y = wl_fixed_to_int(y);
+
 	output->zoom.magnification = 1 / output->zoom.level;
 	ratio = 1 - (1 / output->zoom.magnification);
 
diff --git a/src/shell.c b/src/shell.c
index a44074d..364c07d 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1642,9 +1642,7 @@ zoom_binding(struct wl_input_device *device, uint32_t time,
 			if (output->zoom.level < output->zoom.increment)
 				output->zoom.level = output->zoom.increment;
 
-			weston_output_update_zoom(output,
-			                          wl_fixed_to_int(device->x),
-						  wl_fixed_to_int(device->y));
+			weston_output_update_zoom(output, device->x, device->y);
 		}
 	}
 }
-- 
1.7.7.6



More information about the wayland-devel mailing list