summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Utilities.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-10-01 14:30:16 -0700
committerJoe Onorato <joeo@android.com>2009-10-01 14:30:16 -0700
commitfccc8dfc8a442b8d5ea415e1cba7ffde349319d9 (patch)
tree4fd7b2217fd8c423f2195f6c1207d380f477779b /src/com/android/launcher2/Utilities.java
parentc5acd423146cbbfa015e7b35a3e28092754ce86f (diff)
downloadandroid_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.java7
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);