Skip to content

Commit 35ac3b0

Browse files
committed
fix(TouchController): update cursor and input area in UI thread
1 parent 86b27b0 commit 35ac3b0

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/TouchControllerInputView.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,18 @@ public void updateState(TextInputState textInputState) {
113113

114114
@Override
115115
public void updateCursor(FloatRect cursorRect) {
116-
TouchControllerInputView.this.cursorRect = cursorRect;
117-
updateCursorAnchorInfo();
116+
post(() -> {
117+
TouchControllerInputView.this.cursorRect = cursorRect;
118+
updateCursorAnchorInfo();
119+
});
118120
}
119121

120122
@Override
121123
public void updateArea(FloatRect inputAreaRect) {
122-
TouchControllerInputView.this.inputAreaRect = inputAreaRect;
123-
updateCursorAnchorInfo();
124+
post(() -> {
125+
TouchControllerInputView.this.inputAreaRect = inputAreaRect;
126+
updateCursorAnchorInfo();
127+
});
124128
}
125129

126130
@Override

0 commit comments

Comments
 (0)