mirror of https://github.com/NekoX-Dev/NekoX.git
Fix crash when mention
This commit is contained in:
parent
b1dce3510f
commit
f64c20581d
|
@ -135,6 +135,9 @@ public class EditTextEffects extends EditText {
|
|||
Layout layout = getLayout();
|
||||
if (text instanceof Spannable && layout != null) {
|
||||
int line = layout.getLineForOffset(start);
|
||||
// NekoX: Fix official bug: Mention crash
|
||||
if (start > layout.getText().length())
|
||||
return;
|
||||
int x = (int) layout.getPrimaryHorizontal(start);
|
||||
int y = (int) ((layout.getLineTop(line) + layout.getLineBottom(line)) / 2f);
|
||||
|
||||
|
|
Loading…
Reference in New Issue