summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/util/MotionEventHelper.java
blob: 001f83c4129f0e5c5774b970c4cd2d479be2e286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.android.camera.util;

import android.graphics.Matrix;
import android.view.MotionEvent;

public final class MotionEventHelper {
    private MotionEventHelper() {}

    public static MotionEvent transformEvent(MotionEvent e, Matrix m) {
        // We try to use the new transform method if possible because it uses
        // less memory.
        return transformEventNew(e, m);
    }

    private static MotionEvent transformEventNew(MotionEvent e, Matrix m) {
        MotionEvent newEvent = MotionEvent.obtain(e);
        newEvent.transform(m);
        return newEvent;
    }
}