[PATCH weston 3/4] zoom: fix zoom

Derek Foreman derekf at osg.samsung.com
Tue Mar 24 09:36:15 PDT 2015


Right now zoom only works on the output at 0, 0 because it's adding
the output corner co-ordinates to global co-ordinates that already
include the output offset.

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 src/zoom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/zoom.c b/src/zoom.c
index 5848889..bee038b 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -96,8 +96,8 @@ weston_output_update_zoom_transform(struct weston_output *output)
 	global_x = wl_fixed_to_double(x);
 	global_y = wl_fixed_to_double(y);
 
-	output->zoom.trans_x = global_x - (output->x + output->width / 2);
-	output->zoom.trans_y = global_y - (output->y + output->height / 2);
+	output->zoom.trans_x = global_x - output->width / 2;
+	output->zoom.trans_y = global_y - output->height / 2;
 
 	if (output->zoom.trans_x < 0)
 		output->zoom.trans_x = 0;
-- 
2.1.4



More information about the wayland-devel mailing list