summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-03-21 03:15:00 -0700
committerKeith Packard <keithp@keithp.com>2008-11-24 13:24:40 -0800
commit7e69e364d2ef146d8ec3651d04bdd6d641017449 (patch)
tree9160490c009f688fdd4b70cf6ca2c37480472a91 /hw
parent93179c214fc6ed88f72955a11c69ae0a47316d8c (diff)
Fix rotated/reflected cursor positions.
Doing projective transforms required repositioning the cursor using the hotspot, but that requires relocating the upper left corner in terms of said hotspot.
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/modes/xf86Cursors.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 40657897d..cd4f9e8af 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -330,23 +330,23 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
v.v[0] = x + ScreenPriv->HotX; v.v[1] = y + ScreenPriv->HotY; v.v[2] = 1;
pict_f_transform_point (&crtc->f_framebuffer_to_crtc, &v);
- x = floor (v.v[0] + 0.5) - ScreenPriv->HotX;
- y = floor (v.v[1] + 0.5) - ScreenPriv->HotY;
+ x = floor (v.v[0] + 0.5);
+ y = floor (v.v[1] + 0.5);
+ /*
+ * Transform position of cursor upper left corner
+ */
+ xf86_crtc_rotate_coord_back (crtc->rotation,
+ cursor_info->MaxWidth,
+ cursor_info->MaxHeight,
+ ScreenPriv->HotX, ScreenPriv->HotY, &dx, &dy);
+ x -= dx;
+ y -= dy;
}
else
{
x -= crtc->x;
y -= crtc->y;
}
- /*
- * Transform position of cursor upper left corner
- */
- xf86_crtc_rotate_coord_back (crtc->rotation,
- cursor_info->MaxWidth,
- cursor_info->MaxHeight,
- 0, 0, &dx, &dy);
- x -= dx;
- y -= dy;
/*
* Disable the cursor when it is outside the viewport