Fix too thick gesture trail width

Change-Id: If1b78183b24fa0029bc28e5f56a988372182903e
main
Ken Wakasa 2013-01-10 22:18:23 +09:00
parent 2ef0d3bf8d
commit 4da2ed7a78
1 changed files with 2 additions and 1 deletions

View File

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