diff options
author | Joe Onorato <joeo@android.com> | 2009-10-01 14:30:16 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-10-01 14:30:16 -0700 |
commit | fccc8dfc8a442b8d5ea415e1cba7ffde349319d9 (patch) | |
tree | 4fd7b2217fd8c423f2195f6c1207d380f477779b /src/com/android/launcher2/Utilities.java | |
parent | c5acd423146cbbfa015e7b35a3e28092754ce86f (diff) | |
download | android_packages_apps_Trebuchet-fccc8dfc8a442b8d5ea415e1cba7ffde349319d9.tar.gz android_packages_apps_Trebuchet-fccc8dfc8a442b8d5ea415e1cba7ffde349319d9.tar.bz2 android_packages_apps_Trebuchet-fccc8dfc8a442b8d5ea415e1cba7ffde349319d9.zip |
Center the text in the textures.
Diffstat (limited to 'src/com/android/launcher2/Utilities.java')
-rw-r--r-- | src/com/android/launcher2/Utilities.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java index a7eabe39a..71ac34361 100644 --- a/src/com/android/launcher2/Utilities.java +++ b/src/com/android/launcher2/Utilities.java @@ -403,6 +403,8 @@ final class Utilities { mBitmapWidth = roundToPow2((int)(mBubbleRect.width() + 0.5f)); mBitmapHeight = roundToPow2((int)((MAX_LINES * mLineHeight) + leading + 0.5f)); + mBubbleRect.offsetTo((mBitmapWidth-mBubbleRect.width())/2, 0); + Log.d(TAG, "mBitmapWidth=" + mBitmapWidth + " mBitmapHeight=" + mBitmapHeight + " w=" + ((int)(mBubbleRect.width() + 0.5f)) + " h=" + ((int)((MAX_LINES * mLineHeight) + leading + 0.5f))); @@ -425,7 +427,10 @@ final class Utilities { //c.drawRoundRect(bubbleRect, mCornerRadius, mCornerRadius, mRectPaint); //} for (int i=0; i<lineCount; i++) { - int x = (int)((mBubbleRect.width() - layout.getLineMax(i)) / 2.0f); + //int x = (int)((mBubbleRect.width() - layout.getLineMax(i)) / 2.0f); + //int y = mFirstLineY + (i * mLineHeight); + int x = (int)(mBubbleRect.left + + ((mBubbleRect.width() - layout.getLineMax(i)) / 2.0f)); int y = mFirstLineY + (i * mLineHeight); c.drawText(text.substring(layout.getLineStart(i), layout.getLineEnd(i)), x, y, mTextPaint); |