From 9e63ef89e35f4de91817e3fc4ffab6ce6e699663 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 18 Jan 2013 17:37:21 +0900 Subject: [PATCH] Correct GesturePreviewTrail.getWidth() implementation Bug: 7981153 Change-Id: I20785b7f82329ce6f19c883e77a9716772cda290 --- java/res/values/dimens.xml | 2 +- .../inputmethod/keyboard/internal/GesturePreviewTrail.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index c7d993698..eb0934c63 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -100,7 +100,7 @@ 36% - 12.6dp + 10.0dp 2.5dp 24dp diff --git a/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java b/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java index 4a8407cb5..9f6945da5 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java +++ b/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java @@ -131,10 +131,8 @@ final class GesturePreviewTrail { * @return the width of a gesture trail */ private static float getWidth(final int elapsedTime, final Params params) { - final int deltaTime = params.mTrailLingerDuration - elapsedTime; final float deltaWidth = params.mTrailStartWidth - params.mTrailEndWidth; - return Math.max( - (deltaTime * deltaWidth) / params.mTrailLingerDuration, params.mTrailEndWidth); + return params.mTrailStartWidth - (deltaWidth * elapsedTime) / params.mTrailLingerDuration; } private final RoundedLine mRoundedLine = new RoundedLine();