Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93890b2e authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Unhide getTextBounds for CharSequence

Bug: 112327179
Test: atest android.graphics.cts.PaintTest
Change-Id: I1d2c5c5710dbe15d0352735ce18d9bb9d6f4dbc7
parent 665f5b9b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -14010,6 +14010,7 @@ package android.graphics {
    method public android.graphics.Paint.Style getStyle();
    method public android.graphics.Paint.Align getTextAlign();
    method public void getTextBounds(java.lang.String, int, int, android.graphics.Rect);
    method public void getTextBounds(java.lang.CharSequence, int, int, android.graphics.Rect);
    method public void getTextBounds(char[], int, int, android.graphics.Rect);
    method public java.util.Locale getTextLocale();
    method public android.os.LocaleList getTextLocales();
+3 −1
Original line number Diff line number Diff line
@@ -2599,11 +2599,13 @@ public class Paint {
     * Return in bounds (allocated by the caller) the smallest rectangle that
     * encloses all of the characters, with an implied origin at (0,0).
     *
     * Note that styles are ignored even if you pass {@link android.text.Spanned} instance.
     * Use {@link android.text.StaticLayout} for measuring bounds of {@link android.text.Spanned}.
     *
     * @param text text to measure and return its bounds
     * @param start index of the first char in the text to measure
     * @param end 1 past the last char in the text to measure
     * @param bounds returns the unioned bounds of all the text. Must be allocated by the caller
     * @hide
     */
    public void getTextBounds(CharSequence text, int start, int end, Rect bounds) {
        if ((start | end | (end - start) | (text.length() - end)) < 0) {