Merge "Fix: doRunAdvance returns wrong value when offset == count." into nyc-dev

am: aea43f8

* commit 'aea43f8414c79492beccc55a274700b644bf747a':
  Fix: doRunAdvance returns wrong value when offset == count.

Change-Id: Idc138c0f289de33d44cb9722257ba7334208e516
This commit is contained in:
Keisuke Kuroyanagi
2016-04-01 05:31:33 +00:00
committed by android-build-merger

View File

@@ -823,7 +823,7 @@ namespace PaintGlue {
static jfloat doRunAdvance(const Paint* paint, Typeface* typeface, const jchar buf[], static jfloat doRunAdvance(const Paint* paint, Typeface* typeface, const jchar buf[],
jint start, jint count, jint bufSize, jboolean isRtl, jint offset) { jint start, jint count, jint bufSize, jboolean isRtl, jint offset) {
int bidiFlags = isRtl ? kBidi_Force_RTL : kBidi_Force_LTR; int bidiFlags = isRtl ? kBidi_Force_RTL : kBidi_Force_LTR;
if (offset == count) { if (offset == start + count) {
return MinikinUtils::measureText(paint, bidiFlags, typeface, buf, start, count, return MinikinUtils::measureText(paint, bidiFlags, typeface, buf, start, count,
bufSize, nullptr); bufSize, nullptr);
} }