Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f60cf818 authored by Jason Sams's avatar Jason Sams
Browse files

Improve multitouch support so pointers other than 0 can change colors.

Change-Id: I4f9f71f70306cc4a3b11906ae47a5fa2e305fc3f
parent 60b0c1da
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -71,12 +71,16 @@ public class FountainView extends RSSurfaceView {
    @Override
    @Override
    public boolean onTouchEvent(MotionEvent ev)
    public boolean onTouchEvent(MotionEvent ev)
    {
    {
        int act = ev.getAction();
        int act = ev.getActionMasked();
        if (act == ev.ACTION_UP) {
        if (act == ev.ACTION_UP) {
            mRender.newTouchPosition(0, 0, 0, 0);
            mRender.newTouchPosition(0, 0, 0, ev.getPointerId(0));
            return false;
            return false;
        } else if (act == MotionEvent.ACTION_POINTER_UP) {
            // only one pointer going up, we can get the index like this
            int pointerIndex = ev.getActionIndex();
            int pointerId = ev.getPointerId(pointerIndex);
            mRender.newTouchPosition(0, 0, 0, pointerId);
        }
        }

        int count = ev.getHistorySize();
        int count = ev.getHistorySize();
        int pcount = ev.getPointerCount();
        int pcount = ev.getPointerCount();