Merge "Correct GesturePreviewTrail.getWidth() implementation"

This commit is contained in:
Tadashi G. Takaoka 2013-01-18 10:26:04 +00:00 committed by Android (Google) Code Review
commit 5d894dcfaa
2 changed files with 2 additions and 4 deletions

View file

@ -100,7 +100,7 @@
<fraction name="center_suggestion_percentile">36%</fraction>
<!-- Gesture preview trail parameters -->
<dimen name="gesture_preview_trail_start_width">12.6dp</dimen>
<dimen name="gesture_preview_trail_start_width">10.0dp</dimen>
<dimen name="gesture_preview_trail_end_width">2.5dp</dimen>
<!-- Gesture floating preview text parameters -->
<dimen name="gesture_floating_preview_text_size">24dp</dimen>

View file

@ -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();