summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChris Craik <ccraik@android.com>2014-02-05 21:36:42 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-02-05 21:36:42 +0000
commit449273e2d575041ffe1a5d435666d36923de888b (patch)
tree0fe962b748ae075edc30bd9cce3210a0f3a50bbb /libs
parentbc80e40b160596c262fee0ee4df4b9f15cc14e89 (diff)
parent3ed192760314dc976cd02f62ac49798daa89b4b1 (diff)
downloadframeworks_base-449273e2d575041ffe1a5d435666d36923de888b.zip
frameworks_base-449273e2d575041ffe1a5d435666d36923de888b.tar.gz
frameworks_base-449273e2d575041ffe1a5d435666d36923de888b.tar.bz2
Merge "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 18983d8..8f5beb8 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -404,10 +404,10 @@ void Font::render(SkPaint* paint, const char* text, uint32_t start, uint32_t len
// 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);
}