virtual-keypad 5.13.0 → 5.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/maxKeySize.js +6 -1
package/package.json
CHANGED
package/src/maxKeySize.js
CHANGED
|
@@ -49,6 +49,8 @@ export const applyMaxKeySize = (numberOfKeys) => {
|
|
|
49
49
|
const verticalMarginOffset = Math.floor(freeHeight/2);
|
|
50
50
|
const horizontalMarginOffset = Math.floor(freeWidth/2);
|
|
51
51
|
|
|
52
|
+
const controlKeys = [];
|
|
53
|
+
let controlKeyFontSize = Infinity;
|
|
52
54
|
let keyFontSize;
|
|
53
55
|
let j=0;
|
|
54
56
|
keyElems.forEach((k,i) => {
|
|
@@ -62,7 +64,8 @@ export const applyMaxKeySize = (numberOfKeys) => {
|
|
|
62
64
|
left = (k.id.toLowerCase().includes("space") ? m : m + width + margin);
|
|
63
65
|
|
|
64
66
|
const f = getLargeFontSize(k, width, keyHeightPx-margin);
|
|
65
|
-
|
|
67
|
+
controlKeyFontSize = Math.min(f, controlKeyFontSize);
|
|
68
|
+
controlKeys.push(k);
|
|
66
69
|
k.style.borderRadius = "25px";
|
|
67
70
|
k.style.height = (keyHeightPx - margin)+ "px";
|
|
68
71
|
} else {
|
|
@@ -83,6 +86,8 @@ export const applyMaxKeySize = (numberOfKeys) => {
|
|
|
83
86
|
k.style.left = left + "px";
|
|
84
87
|
k.style.visibility = "visible";
|
|
85
88
|
});
|
|
89
|
+
// Set the control keys to the same size, the smaller of the two
|
|
90
|
+
controlKeys.forEach(k => k.style.fontSize = controlKeyFontSize + "px");
|
|
86
91
|
};
|
|
87
92
|
|
|
88
93
|
const getLargeFontSize = (k, width, height) => {
|