mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-22 01:30:25 +01:00
Use type Vector2i for get_cursor_pos()
Cursor position is always integer.
This commit is contained in:
parent
0ccc539f36
commit
dc97c56b17
3 changed files with 5 additions and 5 deletions
|
@ -133,8 +133,8 @@ int Terminal::get_rows() const
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 Terminal::get_cursor_pos() const {
|
Vector2i Terminal::get_cursor_pos() const {
|
||||||
return Vector2(tsm_screen_get_cursor_x(screen), tsm_screen_get_cursor_y(screen));
|
return Vector2i(tsm_screen_get_cursor_x(screen), tsm_screen_get_cursor_y(screen));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Terminal::set_max_scrollback(const int p_max_scrollback)
|
void Terminal::set_max_scrollback(const int p_max_scrollback)
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace godot
|
||||||
void set_rows(const int p_rows);
|
void set_rows(const int p_rows);
|
||||||
int get_rows() const;
|
int get_rows() const;
|
||||||
|
|
||||||
Vector2 get_cursor_pos() const;
|
Vector2i get_cursor_pos() const;
|
||||||
|
|
||||||
void set_max_scrollback(const int p_max_scrollback);
|
void set_max_scrollback(const int p_max_scrollback);
|
||||||
int get_max_scrollback() const;
|
int get_max_scrollback() const;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class_name TerminalTest extends GutTest
|
class_name TerminalTest extends "res://addons/gut/test.gd"
|
||||||
|
|
||||||
var terminal: Terminal
|
var terminal: Terminal
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class TestCursorPos:
|
||||||
extends TerminalTest
|
extends TerminalTest
|
||||||
|
|
||||||
func test_get_cursor_pos_initial():
|
func test_get_cursor_pos_initial():
|
||||||
assert_eq(terminal.get_cursor_pos(), Vector2.ZERO)
|
assert_eq(terminal.get_cursor_pos(), Vector2i.ZERO)
|
||||||
|
|
||||||
func test_get_cursor_pos_x():
|
func test_get_cursor_pos_x():
|
||||||
terminal.write("_")
|
terminal.write("_")
|
||||||
|
|
Loading…
Reference in a new issue