Fix slow resize Embedded Game Window

This commit is contained in:
Hilderin
2025-01-31 12:02:06 -05:00
parent 1586c5674b
commit 65e14fd16b
3 changed files with 35 additions and 23 deletions

View File

@@ -977,6 +977,11 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, WindowWrapper *p_wrapper) {
game_size_label = memnew(Label());
main_menu_hbox->add_child(game_size_label);
game_size_label->hide();
// Setting the minimum size prevents the game workspace from resizing indefinitely
// due to the label size oscillating by a few pixels when the game is in stretch mode
// and the game workspace is at its minimum size.
game_size_label->set_custom_minimum_size(Size2(80 * EDSCALE, 0));
game_size_label->set_horizontal_alignment(HorizontalAlignment::HORIZONTAL_ALIGNMENT_RIGHT);
panel = memnew(Panel);
add_child(panel);