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

Commit a4510a75 authored by Xavier Ducrohet's avatar Xavier Ducrohet
Browse files

LayoutLib: fix incorrect indices in one of the 2 native_drawTextRun methods.

Fixes http://b.android.com/15007

Change-Id: Iff06180def92c5fa25e82520b76192c089edd8cc
parent 7f4a537a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1043,8 +1043,7 @@ public final class Canvas_Delegate {

    @LayoutlibDelegate
    /*package*/ static void native_drawText(int nativeCanvas, String text,
                                               int start, int end, float x,
                                               float y, int flags, int paint) {
            int start, int end, float x, float y, int flags, int paint) {
        int count = end - start;
        char[] buffer = TemporaryBuffer.obtain(count);
        TextUtils.getChars(text, start, end, buffer, 0);
@@ -1060,7 +1059,7 @@ public final class Canvas_Delegate {
        char[] buffer = TemporaryBuffer.obtain(count);
        TextUtils.getChars(text, start, end, buffer, 0);

        native_drawText(nativeCanvas, buffer, start, end, x, y, flags, paint);
        native_drawText(nativeCanvas, buffer, 0, count, x, y, flags, paint);
    }

    @LayoutlibDelegate