summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eric Fischer <enf@google.com> 2009-08-31 15:14:35 -0700
committer Eric Fischer <enf@google.com> 2009-09-01 10:28:11 -0700
commita82e99a89b7a12bd86d99d60d23a7a37624499b6 (patch)
tree1194c3c5c443720932e29eb0cbd6952110025098
parent57f03f0b5d0228799111651aa6915f7d837d501e (diff)
Fix an emoji-measuring bug that caused an exception when editing a contact.
It was measuring the text to try to determine the size that it needed to scale the emoji character to. Unfortunately it was accidentally trying to measure the character under the cursor instead of the emoji character itself, which is wrong, but more seriously doesn't work at all when the cursor is at the end of the line. This was already fixed before in change 144474, but that change never got merged over to donut. So this merges it now. Bug 2087915 Change-Id: Ib4804d330a029a966207b3b07271f84e6b2652c0
-rw-r--r--core/java/android/text/Layout.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index 29dc2ea5246e..a92800d011ee 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -1527,7 +1527,7 @@ public abstract class Layout {
if (bm != null) {
workPaint.set(paint);
Styled.measureText(paint, workPaint, text,
- offset, offset + 1, null);
+ j, j + 2, null);
float wid = (float) bm.getWidth() *
-workPaint.ascent() / bm.getHeight();