From 8b4072d3fb9bb49d774d97689a065204beca1752 Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Mon, 30 Jul 2012 15:50:00 -0700 Subject: Fix bug 6892600 Font (character pairs) rendering issue Alignment on paint for actual glyph drawing needs to always be left, even when drawing centered or right aligned text. The x offset for alignment is applied by OpenGLRenderer::drawText (and needs to be early in the pipeline for quickReject to work). Similar change needed for drawing drop shadow. Also fixes bug with mispositioned underline (offset for alignment has already been applied once, no need to do it again in drawTextDecorations). Change-Id: Id3dcd62de5536a26b158d768889273a1492b35d6 --- libs/hwui/TextDropShadowCache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs/hwui/TextDropShadowCache.cpp') diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp index 93aa8a5c0af3..8426f5869189 100644 --- a/libs/hwui/TextDropShadowCache.cpp +++ b/libs/hwui/TextDropShadowCache.cpp @@ -107,7 +107,9 @@ ShadowTexture* TextDropShadowCache::get(SkPaint* paint, const char* text, uint32 ShadowTexture* texture = mCache.get(entry); if (!texture) { - FontRenderer::DropShadow shadow = mRenderer->renderDropShadow(paint, text, 0, + SkPaint paintCopy(*paint); + paintCopy.setTextAlign(SkPaint::kLeft_Align); + FontRenderer::DropShadow shadow = mRenderer->renderDropShadow(&paintCopy, text, 0, len, numGlyphs, radius, positions); texture = new ShadowTexture; -- cgit v1.2.3-59-g8ed1b