fixed abbr avatar rounding

This commit is contained in:
gdlbo
2022-08-12 17:32:22 +03:00
parent 8a83052941
commit c525427594
2 changed files with 9 additions and 18 deletions
@@ -47,6 +47,14 @@ public class PicRoundingHook{
}
}
public static void inject(Canvas canvas, Paint paint, float orig){
if (pref > 0) {
canvas.drawRoundRect(new RectF(0, 0, canvas.getWidth(), canvas.getHeight()), AndroidUtils.dp2px(pref), AndroidUtils.dp2px(pref), paint);
} else {
canvas.drawCircle(canvas.getClipBounds().exactCenterX(), canvas.getClipBounds().exactCenterY(), orig, paint);
}
}
public static void inject(Bitmap bitmap, Bitmap bitmap2, Paint b2) {
Shader.TileMode tileMode = Shader.TileMode.CLAMP;
b2.setShader(new BitmapShader(bitmap2, tileMode, tileMode));