aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-04 14:17:00 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-04 14:17:00 +0000
commit9330cfe851b14b8985acc14caa3dc5ad20b0b2a8 (patch)
tree6d605fbb5aae6431fc809e86e1170748b9b7c048
parent0e3c9caae54a7dabbb97f96eec3cd5ef4c555a87 (diff)
drawPosText with center or right align skips every other character.
-rw-r--r--src/core/SkDraw.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 787ba101a0..c6fd4068d4 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1792,6 +1792,7 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
}
} else {
while (text < stop) {
+ const char* currentText = text;
const SkGlyph* glyph = &glyphCacheProc(cache, &text, 0, 0);
if (glyph->fWidth) {
@@ -1817,7 +1818,8 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
}
// have to call again, now that we've been "aligned"
- glyph = &glyphCacheProc(cache, &text, fx & fxMask, fy & fyMask);
+ glyph = &glyphCacheProc(cache, &currentText,
+ fx & fxMask, fy & fyMask);
// the assumption is that the advance hasn't changed
SkASSERT(prevAdvX == glyph->fAdvanceX);
SkASSERT(prevAdvY == glyph->fAdvanceY);