summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChris Craik <ccraik@android.com>2014-02-05 21:52:23 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-05 21:52:23 +0000
commitba9a21561e09bddf4ba25fd41474fda6cb941bfb (patch)
tree605dbc94992170c18eccef4f7bf8d6604a3c7343 /libs
parentb77690cea0f146c6823c922a4f8d8ca7336dde21 (diff)
parent2c764b20e4a35c509f49e3d9430e135b4f3a0984 (diff)
downloadframeworks_base-ba9a21561e09bddf4ba25fd41474fda6cb941bfb.zip
frameworks_base-ba9a21561e09bddf4ba25fd41474fda6cb941bfb.tar.gz
frameworks_base-ba9a21561e09bddf4ba25fd41474fda6cb941bfb.tar.bz2
am 2c764b20: am 0ec3ca6e: am 449273e2: Merge "Fix for positioning of glyphs within a bitmap"
* commit '2c764b20e4a35c509f49e3d9430e135b4f3a0984': Fix for positioning of glyphs within a bitmap
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/font/Font.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index b0945c6..5187f8f 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -405,10 +405,10 @@ void Font::render(const SkPaint* paint, const char* text, uint32_t start, uint32
// If it's still not valid, we couldn't cache it, so we shouldn't
// draw garbage; also skip empty glyphs (spaces)
if (cachedGlyph->mIsValid && cachedGlyph->mCacheTexture) {
- float penX = x + positions[(glyphsCount << 1)];
- float penY = y + positions[(glyphsCount << 1) + 1];
+ int penX = x + (int) roundf(positions[(glyphsCount << 1)]);
+ int penY = y + (int) roundf(positions[(glyphsCount << 1) + 1]);
- (*this.*render)(cachedGlyph, roundf(penX), roundf(penY),
+ (*this.*render)(cachedGlyph, penX, penY,
bitmap, bitmapW, bitmapH, bounds, positions);
}