diff options
author | Christopher R. Palmer <crpalmer@gmail.com> | 2015-05-20 15:29:10 -0400 |
---|---|---|
committer | Abhisek Devkota <ciwrl@cyanogenmod.com> | 2015-05-22 01:02:50 +0000 |
commit | 1723a8dae842a7c6c5b634537b45ba28ffe7c1d8 (patch) | |
tree | 3a0f9fd7ecc3a0efbd8757e06265631e1252c702 | |
parent | b53aa2bb413be1c98c7cb8b02c912c286170f0e0 (diff) | |
download | android_frameworks_base-stable/cm-12.0-YNG3C.tar.gz android_frameworks_base-stable/cm-12.0-YNG3C.tar.bz2 android_frameworks_base-stable/cm-12.0-YNG3C.zip |
Fix another off-by-one error in computeEllipsisstable/cm-12.0-YNG3C
In the START case, we can iterate back before the start of the
string. A similar fix was previously applied to the MIDDLE
case of computeEllipsis:
commit 0e3c5e827235911d33312e431975533f046421e7
Author: Raph Levien <raph@google.com>
Date: Thu Dec 4 13:26:07 2014 -0800
Fix off-by-one error in computeEllipsis
Fixes JIRA: NIGHTLIES-1280.
Change-Id: I081eaec9bce5a8989c8fc1b0d440848b40a66158
(cherry picked from commit d1689f3b3d37c6b0fb11b172b24511da8d3246a7)
-rw-r--r-- | core/java/android/text/StaticLayout.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index e82057ce81e..ccfdcbc98ed 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -663,7 +663,7 @@ public class StaticLayout extends Layout { float sum = 0; int i; - for (i = len; i >= 0; i--) { + for (i = len; i > 0; i--) { float w = widths[i - 1 + lineStart - widthStart]; if (w + sum + ellipsisWidth > avail) { |