Merge "Apply contextStart consistently in getRunAdvance" into mnc-dev
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 63395ed..d14fc0f 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -1055,7 +1055,8 @@
         // TODO performance: optimize JNI array access
         jchar* textArray = env->GetCharArrayElements(text, NULL);
         jfloat result = doRunAdvance(paint, typeface, textArray + contextStart,
-                start - contextStart, end - start, contextEnd - contextStart, isRtl, offset);
+                start - contextStart, end - start, contextEnd - contextStart, isRtl,
+                offset - contextStart);
         env->ReleaseCharArrayElements(text, textArray, JNI_ABORT);
         return result;
     }