Skip to content

Commit 5a3ec71

Browse files
committed
Fix glyph cropping bug
Glyphs were being stored in the glyph cache incorrectly. The second row of glyphs in any column were being positioned exactly one pixel too high, causing the preceding glyph in that column to be cropped, resulting in the reported truncation in some glyphs. Issue #7003215 Minor UI truncation while reading the mails Change-Id: I47ce376f78a04d4e07e8b7ed1b3f0b58864c5498
1 parent 029675e commit 5a3ec71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/hwui/FontRenderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ bool CacheTexture::fitBitmap(const SkGlyph& glyph, uint32_t *retOriginX, uint32_
148148
cacheBlock->mX += roundedUpW;
149149
if (mHeight - glyphH >= glyphH) {
150150
// There's enough height left over to create a new CacheBlock
151-
CacheBlock *newBlock = new CacheBlock(oldX, glyphH, roundedUpW,
152-
mHeight - glyphH);
151+
CacheBlock *newBlock = new CacheBlock(oldX, glyphH + TEXTURE_BORDER_SIZE,
152+
roundedUpW, mHeight - glyphH - TEXTURE_BORDER_SIZE);
153153
#if DEBUG_FONT_RENDERER
154154
ALOGD("fitBitmap: Created new block: this, x, y, w, h = %p, %d, %d, %d, %d",
155155
newBlock, newBlock->mX, newBlock->mY,

0 commit comments

Comments
 (0)