From a82e99a89b7a12bd86d99d60d23a7a37624499b6 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 31 Aug 2009 15:14:35 -0700 Subject: 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 --- core/java/android/text/Layout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java index 29dc2ea..a92800d 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(); -- cgit v1.1