// Paint the bitmap with mask into the result
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
- mCanvas.drawBitmap(scaledBitmap, (w - scaledBitmap.getWidth()) / 2, (h - scaledBitmap.getHeight()) / 2, null);
+ mCanvas.drawBitmap(scaledBitmap, (w - scaledBitmap.getWidth()) / 2.0f, (h - scaledBitmap.getHeight()) / 2.0f, null);
mCanvas.drawBitmap(mutableMask, 0, 0, paint);
paint.setXfermode(null);
} else {
// Paint the bitmap with mask into the result
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
- mCanvas.drawBitmap(scaledBitmap, (w - scaledBitmap.getWidth()) / 2, (h - scaledBitmap.getHeight()) / 2, null);
+ mCanvas.drawBitmap(scaledBitmap, (w - scaledBitmap.getWidth()) / 2.0f, (h - scaledBitmap.getHeight()) / 2.0f, null);
mCanvas.drawBitmap(mutableMask, 0, 0, paint);
paint.setXfermode(null);
private static int getMaxNumOfColumns(Context context) {
SharedPreferences pref = getSharedPreferences(context);
DisplayInfo display = getDisplayInfo(context);
- float density = display.currentDensity / 160;
+ float density = display.currentDensity / 160.0f;
float baseTaskbarSize = getBaseTaskbarSizeFloat(context) / density;
int numOfColumns = 0;