Commit f82fd470 authored by Hans de Goede's avatar Hans de Goede

xf86Cursor: Fix xf86_crtc_rotate_coord using width/height wrongly

xf86_crtc_rotate_coord should be the exact inverse operation of
xf86_crtc_rotate_coord_back, but when calculating x / y for 90 / 270
degrees rotation it was using height to calculate x / width to calculate y,
instead of the otherway around.

This was likely not noticed before since xf86_crtc_rotate_coord
until now was only used with cursor_info->MaxWidth and
cursor_info->MaxHeight, which are usally the same.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
parent b0b04cb2
......@@ -74,7 +74,7 @@ xf86_crtc_rotate_coord(Rotation rotation,
break;
case RR_Rotate_90:
t = x_dst;
x_dst = height - y_dst - 1;
x_dst = width - y_dst - 1;
y_dst = t;
break;
case RR_Rotate_180:
......@@ -84,7 +84,7 @@ xf86_crtc_rotate_coord(Rotation rotation,
case RR_Rotate_270:
t = x_dst;
x_dst = y_dst;
y_dst = width - t - 1;
y_dst = height - t - 1;
break;
}
if (rotation & RR_Reflect_X)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment