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

Commit 8a9f9d88 authored by Brian Muramatsu's avatar Brian Muramatsu
Browse files

Fix Paint#breakText(char[]..) JavaDoc

The JavaDoc says that if the "...count is negative then the
characters before index are measured in reverse order. This
allows for measuring the end of string."

However, the native code doesn't work its way backwards
from the given index when the count is negative. It always
passes Skia the substring starting from index and the
absolute value of count.

Its better to fix the JavaDoc rather than the behavior, since
this API is public and has been this way for some time. It
is also used by TextUtils.ellipsize indirectly, so its best
to avoid breaking that sensitive code.

Change-Id: I8bd51def6ec98251e355370710eb44f58fb737c4
parent d33a4ccb
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1254,9 +1254,7 @@ public class Paint {
     * @param text  The text to measure
     * @param index The offset into text to begin measuring at
     * @param count The number of maximum number of entries to measure. If count
     *              is negative, then the characters before index are measured
     *              in reverse order. This allows for measuring the end of
     *              string.
     *              is negative, then the characters are measured in reverse order.
     * @param maxWidth The maximum width to accumulate.
     * @param measuredWidth Optional. If not null, returns the actual width
     *                     measured.