diff --git a/java/src/org/futo/inputmethod/latin/LatinIME.kt b/java/src/org/futo/inputmethod/latin/LatinIME.kt index 814cd2f16..b66dc222e 100644 --- a/java/src/org/futo/inputmethod/latin/LatinIME.kt +++ b/java/src/org/futo/inputmethod/latin/LatinIME.kt @@ -490,6 +490,7 @@ class LatinIME : InputMethodServiceCompose(), LatinIMELegacy.SuggestionStripCont fun getInputViewHeight(): Int = inputViewHeight fun getViewHeight(): Int = composeView?.height ?: resources.displayMetrics.heightPixels + fun getViewWidth(): Int = composeView?.width ?: resources.displayMetrics.widthPixels private var isInputModal = false fun setInputModal(to: Boolean) { diff --git a/java/src/org/futo/inputmethod/latin/uix/UixManager.kt b/java/src/org/futo/inputmethod/latin/uix/UixManager.kt index af168e7d0..22f365ba7 100644 --- a/java/src/org/futo/inputmethod/latin/uix/UixManager.kt +++ b/java/src/org/futo/inputmethod/latin/uix/UixManager.kt @@ -709,7 +709,7 @@ class UixManager(private val latinIME: LatinIME) { newOffset.y.coerceAtLeast(0.0f) ) newOffset = newOffset.copy( - newOffset.x.coerceAtMost(configuration.screenWidthDp.dp.toPx() - size.width), + newOffset.x.coerceAtMost(latinIME.getViewWidth().toFloat() - size.width), newOffset.y.coerceAtMost(latinIME.getViewHeight().toFloat() - measuredTouchableHeight) )