clients: Fix height typo in clamp_view()
authorBryce Harrington <bryce@osg.samsung.com>
Wed, 9 Sep 2015 02:24:12 +0000 (19:24 -0700)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 9 Sep 2015 07:07:27 +0000 (10:07 +0300)
We should be checking our scaled image height against the allocation
height rather than the allocation width.

Fixes vertical image motion when horizontal motion restricted, i.e.
when window is wide and short compared to the image.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
clients/image.c

index d28f221..4126305 100644 (file)
@@ -93,7 +93,7 @@ clamp_view(struct image *image)
                        image->matrix.x0 = allocation.width - sw;
        }
 
-       if (sh < allocation.width) {
+       if (sh < allocation.height) {
                image->matrix.y0 =
                        (allocation.height - image->height * scale) / 2;
        } else {