From 9a4f10f6bcf49450aa6470b0f276ec1ce59c7514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= Date: Wed, 3 Jul 2013 15:58:22 +0200 Subject: [PATCH] shell: Fix calculation of center point in surface rotation Make sure the center point of a rotation is not rounded to an integer. It makes the calculation consistent with others in the shell. It also ensures surfaces rotated 180 degrees are at the exact same place. --- src/shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell.c b/src/shell.c index aa2db3d1..4f93d3b6 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2885,8 +2885,8 @@ surface_rotate(struct shell_surface *surface, struct weston_seat *seat) return; weston_surface_to_global_float(surface->surface, - surface->surface->geometry.width / 2, - surface->surface->geometry.height / 2, + surface->surface->geometry.width * 0.5f, + surface->surface->geometry.height * 0.5f, &rotate->center.x, &rotate->center.y); dx = wl_fixed_to_double(seat->pointer->x) - rotate->center.x;