summaryrefslogtreecommitdiffstats
path: root/core/jni/android
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2015-06-03 10:58:33 -0700
committerRaph Levien <raph@google.com>2015-06-03 10:58:33 -0700
commit36ff86c9a3d61dfab43b7f35631bf86d65150252 (patch)
tree45d09ad2d6d92f8281796fdd743d5b2f40701b41 /core/jni/android
parentdfe804416014c713df270d94f9c1c0f345eabb84 (diff)
downloadframeworks_base-36ff86c9a3d61dfab43b7f35631bf86d65150252.zip
frameworks_base-36ff86c9a3d61dfab43b7f35631bf86d65150252.tar.gz
frameworks_base-36ff86c9a3d61dfab43b7f35631bf86d65150252.tar.bz2
Apply contextStart consistently in getRunAdvance
The contextStart needs to be applied to all offsets relative to the actual start of context. The code was missing "offset", which caused mischief especially in mixed LTR and RTL text. Bug: 21573666 Change-Id: I47a1b6cde5862442b9c7236ee72b2ceb0df9b2e9
Diffstat (limited to 'core/jni/android')
-rw-r--r--core/jni/android/graphics/Paint.cpp3
1 files changed, 2 insertions, 1 deletions
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 @@ public:
// 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;
}