cursor position reset for going left

This commit is contained in:
minjaesong
2021-10-22 18:26:12 +09:00
parent 9b3384255b
commit ee7115b438
2 changed files with 8 additions and 3 deletions

View File

@@ -379,8 +379,9 @@ Object.freeze({"n":"세벌식 3-90","states":states,
}, },
"end":()=>{ "end":()=>{
console.log(`end composing`) console.log(`end composing`)
let ret = bufAssemble()
reset() reset()
return bufAssemble() return ret
}, },
"reset":()=>{ reset() }, "reset":()=>{ reset() },
"composing":()=>(states.code!=0) "composing":()=>(states.code!=0)

View File

@@ -14,7 +14,6 @@ import net.torvald.terrarum.gamecontroller.TerrarumInputMethod
import net.torvald.terrarum.utils.Clipboard import net.torvald.terrarum.utils.Clipboard
import net.torvald.terrarumsansbitmap.gdx.CodepointSequence import net.torvald.terrarumsansbitmap.gdx.CodepointSequence
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
import java.util.ArrayList
import kotlin.streams.toList import kotlin.streams.toList
data class InputLenCap(val count: Int, val unit: CharLenUnit) { data class InputLenCap(val count: Int, val unit: CharLenUnit) {
@@ -205,7 +204,12 @@ class UIItemTextLineInput(
cursorX -= 1 cursorX -= 1
cursorDrawX = App.fontGame.getWidth(CodepointSequence(textbuf.subList(0, cursorX))) cursorDrawX = App.fontGame.getWidth(CodepointSequence(textbuf.subList(0, cursorX)))
tryCursorForward() tryCursorForward()
} if (cursorX <= 0) {
cursorX = 0
cursorDrawX = 0
cursorDrawScroll = 0
}
}
else if (cursorX < textbuf.size && keycodes.contains(Input.Keys.RIGHT)) { else if (cursorX < textbuf.size && keycodes.contains(Input.Keys.RIGHT)) {
// TODO IME endComposing() // TODO IME endComposing()
cursorX += 1 cursorX += 1