Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 741cd432 authored by Danny Baumann's avatar Danny Baumann Committed by Michael Bestas
Browse files

Fix send button not being centered for non-standard densities.

Change-Id: I6e6717dc7487eeafca121e94d93aff5c3aae5f6c
parent 9a2d82f9
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -355,12 +355,8 @@ public class KeyboardView extends View {
        if (key.needsToKeepBackgroundAspectRatio(mDefaultKeyLabelFlags)
                // HACK: To disable expanding normal/functional key background.
                && !key.hasCustomActionLabel()) {
            final int intrinsicWidth = background.getIntrinsicWidth();
            final int intrinsicHeight = background.getIntrinsicHeight();
            final float minScale = Math.min(
                    keyWidth / (float)intrinsicWidth, keyHeight / (float)intrinsicHeight);
            bgWidth = (int)(intrinsicWidth * minScale);
            bgHeight = (int)(intrinsicHeight * minScale);
            bgWidth = background.getIntrinsicWidth();
            bgHeight = background.getIntrinsicHeight();
            bgX = (keyWidth - bgWidth) / 2;
            bgY = (keyHeight - bgHeight) / 2;
        } else {
@@ -370,10 +366,7 @@ public class KeyboardView extends View {
            bgX = -padding.left;
            bgY = -padding.top;
        }
        final Rect bounds = background.getBounds();
        if (bgWidth != bounds.right || bgHeight != bounds.bottom) {
        background.setBounds(0, 0, bgWidth, bgHeight);
        }
        canvas.translate(bgX, bgY);
        background.draw(canvas);
        canvas.translate(-bgX, -bgY);