mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-15 06:59:43 -05:00
rootston: fix input events for rotated views
This commit is contained in:
parent
c2178d51a8
commit
6a60dafe59
2 changed files with 6 additions and 20 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue