Yes, you are right.  When I replied yesterday, I copy/pasted too fast :(.  The code I committed yesterday was right :).  Yeah, we could use the original modification too. 
 
Thanks so much for your clarification. 

Ping
 
P.S.  The new beta, 0.7.6-3, has been posted yesterday.  I'll update the webpages today.
 
 
On 9/15/06, Antoine Labour <[EMAIL PROTECTED]> wrote:
I don't think the code you suggest will do what you want... maybe you
wanted to write the following :

int diff = ABS(dsOrig->rotation - dsNew->rotation) > 900 ?
(1800 - ABS(dsNew->rotation - dsOrig->rotation)) : ABS(dsNew->rotation -
dsOrig->rotation));
if (diff > suppress) return 0;


I believe that will do it, but so will do the original proposition
(unless you allow the suppress value to go over 900).
A sample is no proof, but just to get the idea of why it works. Take
suppress=10.

Simple cases:
- dsOrig->rotation=50, dsNew->rotation=55
ABS(dsOrig->rotation - dsNew->rotation) == 5, so ABS(dsOrig->rotation -
dsNew->rotation) > suppress is false, ignore the event.

- dsOrig->rotation=-75, dsNew->rotation=-90
ABS(dsOrig->rotation - dsNew->rotation) == 15, so ABS(dsOrig->rotation -
dsNew->rotation) > suppress is true.
(1800 - ABS(dsNew->rotation - dsOrig->rotation)) == 1785, so (1800 -
ABS(dsNew->rotation - dsOrig->rotation)) > suppress is true as well.
Don't ignore the event.

"Complex" cases, going over the origin:
- dsOrig->rotation=-897, dsNew->rotation=899
ABS(dsOrig->rotation - dsNew->rotation) == 1796 so ABS(dsOrig->rotation
- dsNew->rotation) > suppress is true.
(1800 - ABS(dsNew->rotation - dsOrig->rotation)) == 4, so 1800 -
ABS(dsNew->rotation - dsOrig->rotation)) > suppress is false, ignore the
event.

- dsOrig->rotation=-890, dsNew->rotation=895
ABS(dsOrig->rotation - dsNew->rotation) == 1785 so ABS(dsOrig->rotation
- dsNew->rotation) > suppress is true.
(1800 - ABS(dsNew->rotation - dsOrig->rotation)) == 15, o 1800 -
ABS(dsNew->rotation - dsOrig->rotation)) > suppress is also true, don't
ignore the event.


Hope that clarifies things...

Antoine

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Linuxwacom-discuss mailing list
Linuxwacom-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-discuss

Reply via email to