diff options
author | emersion <contact@emersion.fr> | 2019-03-02 13:42:35 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-02 09:37:05 -0700 |
commit | 6a60dafe596e3eed680f6176466d7855222d1395 (patch) | |
tree | 0b1215f63e7134bec2516def572592804239c4d3 /rootston/output.c | |
parent | c2178d51a8af8bc70e4cf468ee4796ff2a9224fc (diff) |
rootston: fix input events for rotated views
Diffstat (limited to 'rootston/output.c')
-rw-r--r-- | rootston/output.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |