diff options
author | emersion <contact@emersion.fr> | 2018-03-18 09:25:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-18 09:25:33 +0100 |
commit | bfc9b13dcd19d89c619281b4a7ad66c08116062c (patch) | |
tree | 97ac312c45a90ec9d15870faaafbc674436d407c /rootston/output.c | |
parent | 1956d3cedb533fb44a7f6a446afe84572838ca39 (diff) | |
parent | a491f780b892b60aa65e17dc5dcb1752a2b78ee7 (diff) |
Merge pull request #730 from martinetd/matrix_rotate
Rootston: fix rotation heading (was: wlr_matrix: fix matrix_rotate)
Diffstat (limited to 'rootston/output.c')
-rw-r--r-- | rootston/output.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/rootston/output.c b/rootston/output.c index b8c73290..4146e3e2 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -29,8 +29,8 @@ static void rotate_child_position(double *sx, double *sy, double sw, double sh, double ox = *sx - pw/2 + sw/2, oy = *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)*ox - sin(rotation)*oy, + ry = cos(rotation)*oy + sin(rotation)*ox; *sx = rx + pw/2 - sw/2; *sy = ry + ph/2 - sh/2; } @@ -227,7 +227,7 @@ static bool surface_intersect_output(struct wlr_surface *surface, .x = lx, .y = ly, .width = surface->current->width, .height = surface->current->height, }; - wlr_box_rotated_bounds(&layout_box, -rotation, &layout_box); + wlr_box_rotated_bounds(&layout_box, rotation, &layout_box); return wlr_output_layout_intersects(output_layout, wlr_output, &layout_box); } @@ -275,7 +275,7 @@ static void render_surface(struct wlr_surface *surface, double lx, double ly, } struct wlr_box rotated; - wlr_box_rotated_bounds(&box, -rotation, &rotated); + wlr_box_rotated_bounds(&box, rotation, &rotated); pixman_region32_t damage; pixman_region32_init(&damage); @@ -341,7 +341,7 @@ static void render_decorations(struct roots_view *view, get_decoration_box(view, output, &box); struct wlr_box rotated; - wlr_box_rotated_bounds(&box, -view->rotation, &rotated); + wlr_box_rotated_bounds(&box, view->rotation, &rotated); pixman_region32_t damage; pixman_region32_init(&damage); @@ -616,7 +616,7 @@ static void damage_whole_surface(struct wlr_surface *surface, return; } - wlr_box_rotated_bounds(&box, -rotation, &box); + wlr_box_rotated_bounds(&box, rotation, &box); wlr_output_damage_add_box(output->damage, &box); } @@ -630,7 +630,7 @@ static void damage_whole_decoration(struct roots_view *view, struct wlr_box box; get_decoration_box(view, output, &box); - wlr_box_rotated_bounds(&box, -view->rotation, &box); + wlr_box_rotated_bounds(&box, view->rotation, &box); wlr_output_damage_add_box(output->damage, &box); } @@ -689,7 +689,7 @@ static void damage_from_surface(struct wlr_surface *surface, .width = (extents->x2 - extents->x1) * wlr_output->scale, .height = (extents->y2 - extents->y1) * wlr_output->scale, }; - wlr_box_rotated_bounds(&damage_box, -rotation, &damage_box); + wlr_box_rotated_bounds(&damage_box, rotation, &damage_box); wlr_output_damage_add_box(output->damage, &damage_box); } } |