fixed characters going off screen at the bottom

This commit is contained in:
Brazly
2026-01-13 05:29:38 +00:00
parent 84d66c13f4
commit 99b3c08d4a

View File

@@ -37,12 +37,16 @@ func reset_blink() -> void:
# --- Input Handling --- # --- Input Handling ---
func InputChar(input) -> void: func InputChar(input) -> void:
var charPos = terminalLine.get_character_bounds(max(0, terminalLine.text.length() - 1))
if input == null: if input == null:
return return
command = input if charPos.end.x > 1600:
terminalLine.text += command pass
UpdateCaretPos() else:
reset_blink() command = input
terminalLine.text += command
UpdateCaretPos()
reset_blink()
func InputDelChar() -> void: func InputDelChar() -> void:
if terminalLine.text.length() > ("user@work " + directory).length() + 1: if terminalLine.text.length() > ("user@work " + directory).length() + 1:
terminalLine.text = terminalLine.text.left(-1) terminalLine.text = terminalLine.text.left(-1)
@@ -166,3 +170,4 @@ func UpdateCaretPos():
var char_rect = terminalLine.get_character_bounds(max(0, last_char_index)) var char_rect = terminalLine.get_character_bounds(max(0, last_char_index))
caret.position.x = char_rect.end.x + 1 caret.position.x = char_rect.end.x + 1
caret.position.y = char_rect.position.y caret.position.y = char_rect.position.y
print(char_rect.end.x)