Fix transformAbsolute
transformAbsolute must use old values if valuator mask doesn't have new ones, and it must only set new values if there was a change. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
463841f45a
commit
31737fff08
|
@ -1057,13 +1057,17 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
|
|||
struct pixman_f_vector p;
|
||||
|
||||
/* p' = M * p in homogeneous coordinates */
|
||||
p.v[0] = valuator_mask_get(mask, 0);
|
||||
p.v[1] = valuator_mask_get(mask, 1);
|
||||
p.v[0] = (valuator_mask_isset(mask, 0) ? valuator_mask_get(mask, 0) :
|
||||
dev->last.valuators[0]);
|
||||
p.v[1] = (valuator_mask_isset(mask, 1) ? valuator_mask_get(mask, 1) :
|
||||
dev->last.valuators[1]);
|
||||
p.v[2] = 1.0;
|
||||
|
||||
pixman_f_transform_point(&dev->transform, &p);
|
||||
|
||||
if (lround(p.v[0]) != dev->last.valuators[0])
|
||||
valuator_mask_set(mask, 0, lround(p.v[0]));
|
||||
if (lround(p.v[1]) != dev->last.valuators[1])
|
||||
valuator_mask_set(mask, 1, lround(p.v[1]));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user