diff options
author | 2014-04-28 23:22:54 +0000 | |
---|---|---|
committer | 2014-04-28 23:22:54 +0000 | |
commit | 54dacbe7ca6d8a8c71d601fcf773e7b27eba3a53 (patch) | |
tree | 564da97136cb4fe447d474deeefc5c9aba4b8a33 | |
parent | 23962cb7dbf9e1743f5c76c5a3bf95eef67d6f1f (diff) | |
parent | 3914a33c01102f5de51e33d006c0aeedf2693af0 (diff) |
am 3914a33c: am 26a5c2dd: Merge "Followon fix for 14276128 Clipping at bottom of TextView" into klp-modular-dev
* commit '3914a33c01102f5de51e33d006c0aeedf2693af0':
Followon fix for 14276128 Clipping at bottom of TextView
-rw-r--r-- | core/java/android/text/BoringLayout.java | 4 | ||||
-rw-r--r-- | core/java/android/text/StaticLayout.java | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/core/java/android/text/BoringLayout.java b/core/java/android/text/BoringLayout.java index 77cd71efc3c3..6f007071018a 100644 --- a/core/java/android/text/BoringLayout.java +++ b/core/java/android/text/BoringLayout.java @@ -188,10 +188,6 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback spacing = metrics.descent - metrics.ascent; } - if (spacingmult != 1 || spacingadd != 0) { - spacing = (int)(spacing * spacingmult + spacingadd + 0.5f); - } - mBottom = spacing; if (includepad) { diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index f7ac75a8147e..0db00f070119 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -632,7 +632,11 @@ public class StaticLayout extends Layout { bottom = fm.bottom; } - if (j == 0) { + boolean firstLine = (j == 0); + boolean currentLineIsTheLastVisibleOne = (j + 1 == mMaximumVisibleLineCount); + boolean lastLine = currentLineIsTheLastVisibleOne || (end == bufEnd); + + if (firstLine) { if (trackPad) { mTopPadding = top - above; } @@ -641,7 +645,10 @@ public class StaticLayout extends Layout { above = top; } } - if (end == bufEnd) { + + int extra; + + if (lastLine) { if (trackPad) { mBottomPadding = bottom - below; } @@ -651,9 +658,8 @@ public class StaticLayout extends Layout { } } - int extra; - if (needMultiply && end != bufEnd) { + if (needMultiply && !lastLine) { double ex = (below - above) * (spacingmult - 1) + spacingadd; if (ex >= 0) { extra = (int)(ex + EXTRA_ROUNDING); @@ -690,8 +696,6 @@ public class StaticLayout extends Layout { if (ellipsize != null) { // If there is only one line, then do any type of ellipsis except when it is MARQUEE // if there are multiple lines, just allow END ellipsis on the last line - boolean firstLine = (j == 0); - boolean currentLineIsTheLastVisibleOne = (j + 1 == mMaximumVisibleLineCount); boolean forceEllipsis = moreChars && (mLineCount + 1 == mMaximumVisibleLineCount); boolean doEllipsis = |