Skip to content

Commit 0c9cacc

Browse files
committed
Fix invalid startup embedded game location and size after resizing editor main area
1 parent 15ff450 commit 0c9cacc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

editor/plugins/game_view_plugin.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ void GameView::_show_update_window_wrapper() {
257257
Point2 offset_embedded_process = embedded_process->get_global_position() - get_global_position();
258258

259259
// On the first startup, the global position of the embedded process control is invalid because it was
260-
// never displayed. We will calculated it manually using the minimum size of the window.
260+
// never displayed. We will calculate it manually using the minimum size of the window.
261261
if (offset_embedded_process == Point2()) {
262262
offset_embedded_process.y = wrapped_min_size.y;
263263
}
@@ -812,9 +812,8 @@ void GameView::_update_arguments_for_instance(int p_idx, List<String> &r_argumen
812812
_update_embed_window_size();
813813
Rect2i rect = embedded_process->get_screen_embedded_window_rect();
814814

815-
// On the first startup, the global rect of the embedded process control is invalid because it was
816-
// never displayed. We will calculated it manually.
817-
if (!window_wrapper->get_window_enabled() && rect.size.y < embedded_process->get_custom_minimum_size().y) {
815+
// Usually, the global rect of the embedded process control is invalid because it was hidden. We will calculate it manually.
816+
if (!window_wrapper->get_window_enabled()) {
818817
Size2 old_min_size = embedded_process->get_custom_minimum_size();
819818
embedded_process->set_custom_minimum_size(Size2i());
820819

0 commit comments

Comments
 (0)