sunil1989 / android-multitouch-controller

Automatically exported from code.google.com/p/android-multitouch-controller
0 stars 0 forks source link

Allow setting of individual fields in PointInfo #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Request from Yuan Chin: provide individual setters in PointInfo class so that 
you don't have to set all fields on every frame. Some apps only want to update 
some params on some operations (e.g. to deal with translation but not scale).

My reply: Yes, I actually had about six set() methods before I committed the 
new version with more params, I thought it was cleaner but I guess that's not 
true on a per-app basis. The problem is that if you have a separate set() for 
position, angle and scale, the controller doesn't know if you're no longer 
updating one of those -- e.g. if you switch from rotation mode to scale mode. 
What really needs to happen is that the PointInfo object needs to be notified 
when there's a new MotionEvent, and it needs to reset its updatingAngle etc. 
fields. But I don't know a clean way to do that, so I have the user specify it 
every time. I'll keep thinking about it.

Original issue reported on code.google.com by luke.hutch on 22 Apr 2012 at 4:52