Ensure terminal is initialized to the correct size

Moves the call to update_size() from _init() to _ready() to ensure
Terminal is initialized to the correct size.
This commit is contained in:
Leroy Hopson 2020-09-25 10:06:46 +07:00
parent e7c14bd76d
commit 66b061bf8b

View file

@ -305,12 +305,11 @@ void Terminal::_init()
{ {
ERR_PRINT("Error setting palette"); ERR_PRINT("Error setting palette");
} }
update_size();
} }
void Terminal::_ready() void Terminal::_ready()
{ {
update_size();
connect("resized", this, "update_size"); connect("resized", this, "update_size");
} }
@ -319,7 +318,6 @@ void Terminal::_notification(int what)
switch (what) switch (what)
{ {
case NOTIFICATION_RESIZED: case NOTIFICATION_RESIZED:
Godot::print("resized!");
update_size(); update_size();
break; break;
} }
@ -555,6 +553,7 @@ void Terminal::update_size()
tsm_screen_resize(screen, cols, rows); tsm_screen_resize(screen, cols, rows);
sleep = false; sleep = false;
framebuffer_age = tsm_screen_draw(screen, text_draw_cb, this);
update(); update();
} }