[weston v2 8/8] shell: Fix calculation of center point in surface rotation
Kristian Høgsberg
hoegsberg at gmail.com
Wed Jul 3 14:09:27 PDT 2013
On Wed, Jul 03, 2013 at 03:58:22PM +0200, Tomeu Vizoso wrote:
> From: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
>
> 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.
Looks good, applied.
Kristian
> ---
> src/shell.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/shell.c b/src/shell.c
> index cadcb55..0ab7fe7 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -3133,8 +3133,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;
> --
> 1.8.3.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list