mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
fix: game crashes on pasting text
This commit is contained in:
@@ -504,7 +504,7 @@ class UIItemTextLineInput(
|
||||
|
||||
textbuf.addAll(actuallyInserted)
|
||||
cursorX += codepoints.size
|
||||
currentTextLenPx = App.fontGame.getWidth(CodepointSequence(textbuf.subList(0, cursorX)))
|
||||
currentTextLenPx = App.fontGame.getWidth(CodepointSequence(textbuf.subList(0, minOf(cursorX, textbuf.size))))
|
||||
moveCursorForward(currentTextLenPx - oldTextLenPx)
|
||||
oldTextLenPx = currentTextLenPx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user