Fix Paint_Delegate.native_getRunAdvance()

Bug: 22249573
Change-Id: I29f7abe6448f439059547e1c1e310d3d651ac2d8
This commit is contained in:
Deepanshu Gupta
2015-07-07 14:38:39 -07:00
parent 490dd90c70
commit cd595f1998

View File

@@ -1171,8 +1171,9 @@ public class Paint_Delegate {
float[] advances = new float[count];
native_getTextRunAdvances(nativePaint, nativeTypeface, text, start, count,
contextStart, contextEnd - contextStart, isRtl, advances, 0);
int startOffset = offset - start; // offset from start.
float sum = 0;
for (int i = 0; i < offset; i++) {
for (int i = 0; i < startOffset; i++) {
sum += advances[i];
}
return sum;