removing some padding from key icons to make them centered
This commit is contained in:
parent
de7f1033d8
commit
535752b422
|
@ -608,7 +608,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||||
paint.setShadowLayer(0f, 0f, 0f, 0)
|
paint.setShadowLayer(0f, 0f, 0f, 0)
|
||||||
} else if (key.icon != null) {
|
} else if (key.icon != null) {
|
||||||
val drawableX = (key.width - padding.left - padding.right - key.icon.intrinsicWidth) / 2 + padding.left
|
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())
|
canvas.translate(drawableX.toFloat(), drawableY.toFloat())
|
||||||
key.icon.setBounds(0, 0, key.icon.intrinsicWidth, key.icon.intrinsicHeight)
|
key.icon.setBounds(0, 0, key.icon.intrinsicWidth, key.icon.intrinsicHeight)
|
||||||
key.icon.draw(canvas)
|
key.icon.draw(canvas)
|
||||||
|
|
Loading…
Reference in New Issue