dix: force a minimum of 0 for screen coordinates.

Currently the root coordinates may fall into ]-1..0] if the subpixel
remainder is less than 0. Screen coordinates mustn't go below 0, so use
miPointerSetPosition to cap off the remainder if the coordinates are below
0.

This is cheating a bit, a more comprehensive solution to deal with subpixels
correctly when crossing screens is needed. For now, this'll do.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Simon Thum <simon.thum@gmx.de>
(cherry picked from commit 45f447dafd)
This commit is contained in:
Peter Hutterer 2009-10-01 21:19:11 +10:00
parent 3788113618
commit 15b4faff28
1 changed files with 13 additions and 0 deletions

View File

@ -781,6 +781,19 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac,
*screeny_frac = dev->last.remainder[1];
}
/* Hit the left screen edge? */
if (*screenx <= 0 && *screenx_frac < 0.0f)
{
*screenx_frac = 0.0f;
x_frac = 0.0f;
}
if (*screeny <= 0 && *screeny_frac < 0.0f)
{
*screeny_frac = 0.0f;
y_frac = 0.0f;
}
old_screenx = *screenx;
old_screeny = *screeny;
/* This takes care of crossing screens for us, as well as clipping