diff options
author | Raph Levien <raph@google.com> | 2015-06-01 14:27:00 -0700 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2015-06-01 14:27:00 -0700 |
commit | 95af01c57b60130ba4c098340ba6ea4b4ebfee3f (patch) | |
tree | 1085280da43d87ae85d2a100ab484f46272cea36 | |
parent | 0dc07c0be325b7c12c50729e04c4b2785a673fd7 (diff) | |
download | android_frameworks_minikin-95af01c57b60130ba4c098340ba6ea4b4ebfee3f.tar.gz android_frameworks_minikin-95af01c57b60130ba4c098340ba6ea4b4ebfee3f.tar.bz2 android_frameworks_minikin-95af01c57b60130ba4c098340ba6ea4b4ebfee3f.zip |
Use context start correctly in getRunAdvance
We were not taking context start into account when deciding whether
to split a ligature, which was causing inconsistent behavior. This
patch consistently references the widths array relative to the start
of the context.
Bug: 21549197
Change-Id: I7c71e10c1af84354fefe782fc0b87120016e6555
-rw-r--r-- | libs/minikin/Measurement.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/minikin/Measurement.cpp b/libs/minikin/Measurement.cpp index 21df5d8..98d2c01 100644 --- a/libs/minikin/Measurement.cpp +++ b/libs/minikin/Measurement.cpp @@ -41,7 +41,7 @@ float getRunAdvance(Layout& layout, const uint16_t* buf, size_t start, size_t co clusterWidth = charAdvance; } } - if (offset < start + count && layout.getCharAdvance(offset) == 0.0f) { + if (offset < start + count && layout.getCharAdvance(offset - start) == 0.0f) { // In the middle of a cluster, distribute width of cluster so that each grapheme cluster // gets an equal share. // TODO: get caret information out of font when that's available |