removing some padding from key icons to make them centered

This commit is contained in:
tibbi 2022-01-08 18:10:45 +01:00
parent de7f1033d8
commit 535752b422
1 changed files with 1 additions and 1 deletions

View File

@ -608,7 +608,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
paint.setShadowLayer(0f, 0f, 0f, 0)
} else if (key.icon != null) {
val drawableX = (key.width - padding.left - padding.right - key.icon.intrinsicWidth) / 2 + padding.left
val drawableY = (key.height - padding.top - padding.bottom - key.icon.intrinsicHeight) / 2 + paddingTop
val drawableY = (key.height - key.icon.intrinsicHeight) / 2
canvas.translate(drawableX.toFloat(), drawableY.toFloat())
key.icon.setBounds(0, 0, key.icon.intrinsicWidth, key.icon.intrinsicHeight)
key.icon.draw(canvas)