From 6a60dafe596e3eed680f6176466d7855222d1395 Mon Sep 17 00:00:00 2001 From: emersion Date: Sat, 2 Mar 2019 13:42:35 +0100 Subject: rootston: fix input events for rotated views --- rootston/output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rootston/output.c') diff --git a/rootston/output.c b/rootston/output.c index a6cdc25d..bc2f4d6c 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -30,11 +30,11 @@ void rotate_child_position(double *sx, double *sy, double sw, double sh, } // Coordinates relative to the center of the subsurface - double ox = *sx - pw/2 + sw/2, - oy = *sy - ph/2 + sh/2; + double cx = *sx - pw/2 + sw/2, + cy = *sy - ph/2 + sh/2; // Rotated coordinates - double rx = cos(rotation)*ox - sin(rotation)*oy, - ry = cos(rotation)*oy + sin(rotation)*ox; + double rx = cos(rotation)*cx - sin(rotation)*cy, + ry = cos(rotation)*cy + sin(rotation)*cx; *sx = rx + pw/2 - sw/2; *sy = ry + ph/2 - sh/2; } -- cgit v1.2.3