am 420cf236: Merge "Make measureText(String, int, int) not use context" into mnc-dev

* commit '420cf236762db164ef8d37b336ee18ba84aab5b6':
  Make measureText(String, int, int) not use context
This commit is contained in:
Raph Levien
2015-06-24 21:23:17 +00:00
committed by Android Git Automerger

View File

@@ -606,7 +606,9 @@ public:
Layout layout;
TypefaceImpl* typeface = getNativeTypeface(env, jpaint);
MinikinUtils::doLayout(&layout, paint, bidiFlags, typeface, textArray, start, count, textLength);
// Only the substring is used for measurement, so no additional context is passed in. This
// behavior is consistent between char[] and String specializations.
MinikinUtils::doLayout(&layout, paint, bidiFlags, typeface, textArray + start, 0, count, count);
width = layout.getAdvance();
env->ReleaseStringChars(text, textArray);