mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
output: fix transform matrix for 90/270 rotations
We need to adjust the second translation depending on the transform
we applied.
Fixes: 9601a2abf0 ("output: improve transform matrix calculation"
Closes: https://github.com/swaywm/wlroots/issues/2774
This commit is contained in:
parent
9601a2abf0
commit
44fa2c4b49
4 changed files with 25 additions and 9 deletions
|
|
@ -434,9 +434,13 @@ static bool output_set_cursor(struct wlr_output *wlr_output,
|
|||
float output_matrix[9];
|
||||
wlr_matrix_identity(output_matrix);
|
||||
if (wlr_output->transform != WL_OUTPUT_TRANSFORM_NORMAL) {
|
||||
struct wlr_box tr_size = { .width = width, .height = height };
|
||||
wlr_box_transform(&tr_size, &tr_size, wlr_output->transform, 0, 0);
|
||||
|
||||
wlr_matrix_translate(output_matrix, width / 2.0, height / 2.0);
|
||||
wlr_matrix_transform(output_matrix, wlr_output->transform);
|
||||
wlr_matrix_translate(output_matrix, - width / 2.0, - height / 2.0);
|
||||
wlr_matrix_translate(output_matrix,
|
||||
- tr_size.width / 2.0, - tr_size.height / 2.0);
|
||||
}
|
||||
|
||||
float matrix[9];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue