From 1aef3f5253863e6c563bc118786fbcc3f11769fe Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Sun, 28 Jan 2018 14:21:53 -0500 Subject: [PATCH] Preserve float result from division The arguments to drawText for x and y are float, but dividing two integers truncates the result to an integer. --- app/src/main/java/protect/card_locker/LetterBitmap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/protect/card_locker/LetterBitmap.java b/app/src/main/java/protect/card_locker/LetterBitmap.java index 1da85720d..e8046c57d 100644 --- a/app/src/main/java/protect/card_locker/LetterBitmap.java +++ b/app/src/main/java/protect/card_locker/LetterBitmap.java @@ -98,8 +98,8 @@ class LetterBitmap mFirstChar[0] = firstChar.toUpperCase().charAt(0); mPaint.setTextSize(mTileLetterFontSize); mPaint.getTextBounds(mFirstChar, 0, 1, mBounds); - c.drawText(mFirstChar, 0, 1, width / 2, height / 2 - + (mBounds.bottom - mBounds.top) / 2, mPaint); + c.drawText(mFirstChar, 0, 1, width / 2.0f, height / 2.0f + + (mBounds.bottom - mBounds.top) / 2.0f, mPaint); return bitmap; }