From 6ffb827ad540ada88f33742e58abd79acd5d660f Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 20 Jul 2011 19:05:27 -0700 Subject: [PATCH] Fix centering key icon when visual inset is specified Change-Id: Iae9cb87cc341a88fab269b629aa45c77adf232be --- java/src/com/android/inputmethod/keyboard/KeyboardView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 71c4896a7..d23b8ff0e 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -526,7 +526,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { canvas.translate(-bgX, -bgY); // Draw key top visuals. - final int keyWidth = key.mWidth; + final int keyWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight; final int keyHeight = key.mHeight; final float centerX = keyWidth * 0.5f; final float centerY = keyHeight * 0.5f;