mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Correct GesturePreviewTrail.getWidth() implementation
Bug: 7981153 Change-Id: I20785b7f82329ce6f19c883e77a9716772cda290
This commit is contained in:
parent
e6a9655a03
commit
9e63ef89e3
@ -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>
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user