@@ -45,7 +45,7 @@ public class Key
4545 public String valueTextShifted ; // overrides displayText drawn when shifted
4646
4747 // Key dimensions
48- public int width ;
48+ public int width , naturalWidth ;
4949 public int height , naturalHeight ;
5050
5151 // Key styles
@@ -55,13 +55,13 @@ public class Key
5555 public int textColour ;
5656 public int textSwipeColour ;
5757 public int textSize ;
58- public int textOffsetX ;
58+ public int textOffsetX , naturalTextOffsetX ;
5959 public int textOffsetY , naturalTextOffsetY ;
6060 public float previewMagnification ;
6161 public int previewMarginY , naturalPreviewMarginY ;
6262
6363 // Key position
64- public int x ;
64+ public int x , naturalX ;
6565 public int y , naturalY ;
6666
6767 // Key meta-properties
@@ -70,7 +70,7 @@ public class Key
7070 public Key (final Row parentRow )
7171 {
7272 grandparentKeyboard = parentRow .parentKeyboard ;
73- width = parentRow .keyWidth ;
73+ width = naturalWidth = parentRow .keyWidth ;
7474 height = naturalHeight = parentRow .keyHeight ;
7575 }
7676
@@ -83,7 +83,7 @@ public Key(final Row parentRow,
8383 {
8484 this (parentRow );
8585
86- this .x = x ;
86+ this .x = naturalX = x ;
8787 this .y = naturalY = y ;
8888
8989 final TypedArray attributesArray =
@@ -114,7 +114,7 @@ else if (valueTextShifted == null)
114114 valueTextShifted = displayText ;
115115 }
116116
117- width =
117+ width = naturalWidth =
118118 Valuey .getDimensionOrFraction (
119119 attributesArray ,
120120 R .styleable .Key_keyWidth ,
@@ -139,7 +139,8 @@ else if (valueTextShifted == null)
139139 textColour = attributesArray .getColor (R .styleable .Key_keyTextColour , parentRow .keyTextColour );
140140 textSwipeColour = attributesArray .getColor (R .styleable .Key_keyTextSwipeColour , parentRow .keyTextSwipeColour );
141141 textSize = attributesArray .getDimensionPixelSize (R .styleable .Key_keyTextSize , parentRow .keyTextSize );
142- textOffsetX = attributesArray .getDimensionPixelSize (R .styleable .Key_keyTextOffsetX , parentRow .keyTextOffsetX );
142+ textOffsetX = naturalTextOffsetX =
143+ attributesArray .getDimensionPixelSize (R .styleable .Key_keyTextOffsetX , parentRow .keyTextOffsetX );
143144 textOffsetY = naturalTextOffsetY =
144145 attributesArray .getDimensionPixelSize (R .styleable .Key_keyTextOffsetY , parentRow .keyTextOffsetY );
145146
0 commit comments