mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-02 06:42:47 -04:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user