From 4da2ed7a78c63284fa3869450a492ee7ae420ed9 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Thu, 10 Jan 2013 22:18:23 +0900 Subject: [PATCH] Fix too thick gesture trail width Change-Id: If1b78183b24fa0029bc28e5f56a988372182903e --- .../inputmethod/keyboard/internal/GesturePreviewTrail.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java b/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java index f8949b2ad..a8407254f 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java +++ b/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java @@ -133,7 +133,8 @@ final class GesturePreviewTrail { private static float getWidth(final int elapsedTime, final Params params) { final int deltaTime = params.mTrailLingerDuration - elapsedTime; final float deltaWidth = params.mTrailStartWidth - params.mTrailEndWidth; - return (deltaTime * deltaWidth) / params.mTrailLingerDuration + params.mTrailEndWidth; + return Math.max( + (deltaTime * deltaWidth) / params.mTrailLingerDuration, params.mTrailEndWidth); } private final RoundedLine mRoundedLine = new RoundedLine();