Add method get_cell_size()

This commit is contained in:
Leroy Hopson 2024-02-18 18:30:40 +13:00
parent 685884965e
commit 6d112ca0f2
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
2 changed files with 6 additions and 0 deletions

View file

@ -69,6 +69,7 @@ void Terminal::_bind_methods()
ClassDB::bind_method(D_METHOD("write", "data"), &Terminal::write); ClassDB::bind_method(D_METHOD("write", "data"), &Terminal::write);
ClassDB::bind_method(D_METHOD("get_cursor_pos"), &Terminal::get_cursor_pos); ClassDB::bind_method(D_METHOD("get_cursor_pos"), &Terminal::get_cursor_pos);
ClassDB::bind_method(D_METHOD("get_cell_size"), &Terminal::get_cell_size);
ClassDB::bind_method(D_METHOD("_on_gui_input", "event"), &Terminal::_gui_input); ClassDB::bind_method(D_METHOD("_on_gui_input", "event"), &Terminal::_gui_input);
ClassDB::bind_method(D_METHOD("_on_selection_held"), &Terminal::_on_selection_held); ClassDB::bind_method(D_METHOD("_on_selection_held"), &Terminal::_on_selection_held);
} }
@ -137,6 +138,10 @@ Vector2i Terminal::get_cursor_pos() const {
return Vector2i(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));
} }
Vector2 Terminal::get_cell_size() const {
return cell_size;
}
void Terminal::set_max_scrollback(const int p_max_scrollback) void Terminal::set_max_scrollback(const int p_max_scrollback)
{ {
max_scrollback = std::max(0, p_max_scrollback); max_scrollback = std::max(0, p_max_scrollback);

View file

@ -57,6 +57,7 @@ namespace godot
int get_rows() const; int get_rows() const;
Vector2i get_cursor_pos() const; Vector2i get_cursor_pos() const;
Vector2 get_cell_size() 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;