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

Commit ccaa799e authored by Tom Ouyang's avatar Tom Ouyang
Browse files

Update gesture bounding box handling.

Change-Id: I085611ce6fd82608f284d74973e5bb14258cdc24
parent 7e220d3c
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -919,15 +919,14 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
        if (mPreviewPlacer == null) {
            createPreviewPlacer();
        }
        final Rect r = tracker.getDrawingRect();
        final Rect r = tracker.getBoundingBox();
        if (!r.isEmpty()) {
            // Invalidate the rectangular region encompassing the gesture. This is needed because
            // past points along the gesture will fade and gradually disappear.
            final KeyPreviewDrawParams params = mKeyPreviewDrawParams;
            mInvalidatedGesturesRect.set(r.left + params.mCoordinates[0] - GESTURE_DRAWING_WIDTH,
                    r.top + params.mCoordinates[1] - GESTURE_DRAWING_WIDTH,
                    r.right + params.mCoordinates[0] + GESTURE_DRAWING_WIDTH,
                    r.bottom + params.mCoordinates[1] + GESTURE_DRAWING_WIDTH);
            mInvalidatedGesturesRect.set(r);
            mInvalidatedGesturesRect.offset(params.mCoordinates[0], params.mCoordinates[1]);
            mInvalidatedGesturesRect.inset(-GESTURE_DRAWING_WIDTH, -GESTURE_DRAWING_WIDTH);
            mPreviewPlacer.invalidate(mInvalidatedGesturesRect);
        } else {
            mPreviewPlacer.invalidate();
+2 −2
Original line number Diff line number Diff line
@@ -536,8 +536,8 @@ public class PointerTracker {
    public long getDownTime() {
        return mDownTime;
    }
    public Rect getDrawingRect() {
        return mGestureStroke.getDrawingRect();
    public Rect getBoundingBox() {
        return mGestureStroke.getBoundingBox();
    }

    private Key onDownKey(int x, int y, long eventTime) {
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ public class GestureStroke {
        }
    }

    public Rect getDrawingRect() {
    public Rect getBoundingBox() {
        return mDrawingRect;
    }
}