mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
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.
Former-commit-id: 66b061bf8b
This commit is contained in:
parent
a0a9ffb11e
commit
313f6b8b60
1 changed files with 2 additions and 3 deletions
|
@ -305,12 +305,11 @@ void Terminal::_init()
|
|||
{
|
||||
ERR_PRINT("Error setting palette");
|
||||
}
|
||||
|
||||
update_size();
|
||||
}
|
||||
|
||||
void Terminal::_ready()
|
||||
{
|
||||
update_size();
|
||||
connect("resized", this, "update_size");
|
||||
}
|
||||
|
||||
|
@ -319,7 +318,6 @@ void Terminal::_notification(int what)
|
|||
switch (what)
|
||||
{
|
||||
case NOTIFICATION_RESIZED:
|
||||
Godot::print("resized!");
|
||||
update_size();
|
||||
break;
|
||||
}
|
||||
|
@ -555,6 +553,7 @@ void Terminal::update_size()
|
|||
tsm_screen_resize(screen, cols, rows);
|
||||
|
||||
sleep = false;
|
||||
framebuffer_age = tsm_screen_draw(screen, text_draw_cb, this);
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue