zoom: fix zoom
authorDerek Foreman <derekf@osg.samsung.com>
Tue, 24 Mar 2015 16:36:15 +0000 (11:36 -0500)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 27 Mar 2015 07:17:16 +0000 (09:17 +0200)
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@osg.samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
src/zoom.c

index 58488896c1027acd5ddf98ca8c4bfb505c2be08f..bee038b1d8a6c32ed66a9af28cf5ba03b7319a34 100644 (file)
@@ -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;