summaryrefslogtreecommitdiff
path: root/core/java/android/text/TextLine.java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2011-04-28 15:08:54 -0700
committerGilles Debunne <debunne@google.com>2011-04-28 15:08:57 -0700
commitf483e514d4ed3b93cc5ba22beb9c85efcda75535 (patch)
tree8ce6f083f1a5e2eda935f6e323f0dd1faa4ec61a /core/java/android/text/TextLine.java
parent75e3ef048d8826f0db58f117403ce412e1d076a7 (diff)
TextView's baseline is correctly computed for empty text.
Bug http://code.google.com/p/android/issues/detail?id=15598 Change-Id: I3aae29b55dc92acca3883b8d14e01dc1c79c2243
Diffstat (limited to 'core/java/android/text/TextLine.java')
-rw-r--r--core/java/android/text/TextLine.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java
index 1b7f2f310c9f..0f8097a948a6 100644
--- a/core/java/android/text/TextLine.java
+++ b/core/java/android/text/TextLine.java
@@ -815,6 +815,13 @@ class TextLine {
int limit, boolean runIsRtl, Canvas c, float x, int top, int y,
int bottom, FontMetricsInt fmi, boolean needWidth) {
+ // Case of an empty line, make sure we update fmi according to mPaint
+ if (start == measureLimit) {
+ TextPaint wp = mWorkPaint;
+ wp.set(mPaint);
+ return handleText(wp, 0, 0, 0, 0, runIsRtl, c, x, top, y, bottom, fmi, needWidth);
+ }
+
// Shaping needs to take into account context up to metric boundaries,
// but rendering needs to take into account character style boundaries.
// So we iterate through metric runs to get metric bounds,