Bug # 10324: dix: Allow arbitrary value ranges in GetPointerEvents

Don't use a possitive value as a marker for if a max-value
is defined on the valuators. Use the existence of a valid
value range instead. This will also make it possible to
define arbitrary start and end-values for min and max as
long as min < max.
This commit is contained in:
Magnus Vigerlöf 2008-02-02 22:45:31 +01:00
parent 12e5324032
commit f04c083869

View File

@ -308,10 +308,13 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
{
AxisInfoPtr axes = pDev->valuator->axes + axisNum;
if (*val < axes->min_value)
*val = axes->min_value;
if (axes->max_value >= 0 && *val > axes->max_value)
*val = axes->max_value;
/* No clipping if the value-range <= 0 */
if(axes->min_value < axes->min_value) {
if (*val < axes->min_value)
*val = axes->min_value;
if (*val > axes->max_value)
*val = axes->max_value;
}
}
/**