fixed characters going off screen at the bottom
This commit is contained in:
@@ -37,8 +37,12 @@ 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
|
||||||
|
if charPos.end.x > 1600:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
command = input
|
command = input
|
||||||
terminalLine.text += command
|
terminalLine.text += command
|
||||||
UpdateCaretPos()
|
UpdateCaretPos()
|
||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user