diff options
| author | Roozbeh Pournader <roozbeh@google.com> | 2017-06-05 15:57:14 -0700 |
|---|---|---|
| committer | Roozbeh Pournader <roozbeh@google.com> | 2017-06-05 15:57:14 -0700 |
| commit | fd8c22d513d92d547f883efc45a3dbcd9558f90a (patch) | |
| tree | d631419d14c2172612ab147c0306a5fe00e8f713 /core/java/android/text/TextPaint.java | |
| parent | a3112ceedc146005779dba2825af5484d55c8827 (diff) | |
Move underline thickness and position computation to Paint
Also, in TextLine, fix underline color and thickness to come from the
underline info rather than the TextPaint object.
Bug: 32907446
Bug: 62353930
Test: Manual
Test: cts-tradefed run cts-dev --module CtsTextTestCases
Test: cts-tradefed run cts-dev --module CtsWidgetTestCases
Change-Id: I259e9cf635a7056ccd367baa77c03100c69e3b98
Diffstat (limited to 'core/java/android/text/TextPaint.java')
| -rw-r--r-- | core/java/android/text/TextPaint.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/text/TextPaint.java b/core/java/android/text/TextPaint.java index 1b062cf8adcf..5234fa9a594b 100644 --- a/core/java/android/text/TextPaint.java +++ b/core/java/android/text/TextPaint.java @@ -102,4 +102,16 @@ public class TextPaint extends Paint { underlineColor = color; underlineThickness = thickness; } + + /** + * @hide + */ + @Override + public float getUnderlineThickness() { + if (underlineColor != 0) { // Return custom thickness only if underline color is set. + return underlineThickness; + } else { + return super.getUnderlineThickness(); + } + } } |
