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:
parent
12e5324032
commit
f04c083869
|
@ -308,11 +308,14 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
|
||||||
{
|
{
|
||||||
AxisInfoPtr axes = pDev->valuator->axes + axisNum;
|
AxisInfoPtr axes = pDev->valuator->axes + axisNum;
|
||||||
|
|
||||||
|
/* No clipping if the value-range <= 0 */
|
||||||
|
if(axes->min_value < axes->min_value) {
|
||||||
if (*val < axes->min_value)
|
if (*val < axes->min_value)
|
||||||
*val = axes->min_value;
|
*val = axes->min_value;
|
||||||
if (axes->max_value >= 0 && *val > axes->max_value)
|
if (*val > axes->max_value)
|
||||||
*val = axes->max_value;
|
*val = axes->max_value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clip every axis in the list of valuators to its bounds.
|
* Clip every axis in the list of valuators to its bounds.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user