Skip to content

Commit

Permalink
fix: landscape keyboard's keys' position
Browse files Browse the repository at this point in the history
  • Loading branch information
goofyz committed Apr 11, 2024
1 parent b6ecf00 commit 96db7f5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/src/main/java/com/osfans/trime/ime/keyboard/Keyboard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,17 @@ class Keyboard() {
horizontalGap,
verticalGap,
autoHeightIndex,
)
.calc(lm)
defaultWidth = (oneWeightWidthPx * keyboardKeyWidth).toInt()
).calc(lm)

try {
var rowWidthWeight = 0f
for (mk in lm) {
val gap = this.horizontalGap
val keyWidth = obtainFloat(mk, "width", 0f)
var keyWidth = obtainFloat(mk, "width", 0f)
if (keyWidth == 0f && mk.containsKey("click")) {
keyWidth = keyboardKeyWidth
}
var widthPx = (keyWidth * oneWeightWidthPx).toInt()
if (widthPx == 0 && mk.containsKey("click")) widthPx = defaultWidth
widthPx -= gap
if (column >= maxColumns || x + widthPx > mDisplayWidth) {
// new row
Expand Down

0 comments on commit 96db7f5

Please sign in to comment.