File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
app/src/main/java/org/fcitx/fcitx5/android/input Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -163,11 +163,13 @@ class CandidatesView(
163
163
} else {
164
164
if (horizontal + selfWidth > parentWidth) parentWidth - selfWidth else horizontal
165
165
}
166
- val bottomSpace = parentHeight - bottomInsets
166
+ val bottomLimit = parentHeight - bottomInsets
167
+ val bottomSpace = bottomLimit - bottom
167
168
// move CandidatesView above cursor anchor, only when
168
- // bottom space is not enough && top space is larger than bottom
169
- val tY: Float =
170
- if (bottom + selfHeight > bottomSpace && top > bottomSpace) top - selfHeight else bottom
169
+ val tY: Float = if (
170
+ bottom + selfHeight > bottomLimit // bottom space is not enough
171
+ && top > bottomSpace // top space is larger than bottom
172
+ ) top - selfHeight else bottom
171
173
translationX = tX
172
174
translationY = tY
173
175
// update touchEventReceiverWindow's position after CandidatesView's
You can’t perform that action at this time.
0 commit comments