From 808a0bac33fc78735f23e8b7a2486e2e065869d0 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 27 Jan 2020 14:52:04 +0800 Subject: [PATCH 01/32] Fixes OptionButton min size (cherry picked from commit ddc397d9ff81294b73609e9e834a2c11bfe4b99e) --- scene/gui/option_button.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 8598a953b47..3f46afa8e82 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -36,7 +36,14 @@ Size2 OptionButton::get_minimum_size() const { Size2 minsize = Button::get_minimum_size(); if (has_icon("arrow")) { - minsize.width += Control::get_icon("arrow")->get_width() + get_constant("hseparation"); + const Size2 padding = get_stylebox("normal")->get_minimum_size(); + const Size2 arrow_size = Control::get_icon("arrow")->get_size(); + + Size2 content_size = minsize - padding; + content_size.width += arrow_size.width + get_constant("hseparation"); + content_size.height = MAX(content_size.height, arrow_size.height); + + minsize = content_size + padding; } return minsize; From 6cb4ec2289a53283436bb9df8174a59e9d685485 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Wed, 29 Jan 2020 12:52:07 -0300 Subject: [PATCH 02/32] Clip warning text in the remote dock (cherry picked from commit 0faadcae8f0898a063afac95dde1b3ef007ce872) --- editor/inspector_dock.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 2be3464d30b..b65482cc6bb 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -584,6 +584,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { add_child(warning); warning->set_text(TTR("Changes may be lost!")); warning->set_icon(get_icon("NodeWarning", "EditorIcons")); + warning->set_clip_text(true); warning->hide(); warning->connect("pressed", this, "_warning_pressed"); From 04cfcb3ba0c727c7d767b6ae8535134161713d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20L?= Date: Wed, 29 Jan 2020 14:54:40 -0300 Subject: [PATCH 03/32] Fixed GetNodeOrNull GetNodeOrNull was using GetNode instead of GetNodeOrNull (cherry picked from commit f59548607674585392b636dcba4a83c091cfa86f) --- .../GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs index 5023725f174..5d16260f5d6 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/NodeExtensions.cs @@ -9,7 +9,7 @@ namespace Godot public T GetNodeOrNull(NodePath path) where T : class { - return GetNode(path) as T; + return GetNodeOrNull(path) as T; } public T GetChild(int idx) where T : class From 786b1cc7ffea74a5560a9dda8e89196a211592e2 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Fri, 31 Jan 2020 09:11:17 +0300 Subject: [PATCH 04/32] Fix shader crash if using multiple underscores in identifier names (cherry picked from commit 15358b808be0cf6ab20ff2d2e23b82fa9a2cf30d) --- drivers/gles2/shader_compiler_gles2.cpp | 2 +- drivers/gles3/shader_compiler_gles3.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 24b89aedc27..5dec6f2fee6 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -80,7 +80,7 @@ static String _opstr(SL::Operator p_op) { static String _mkid(const String &p_id) { - String id = "m_" + p_id; + String id = "m_" + p_id.replace("__", "_dus_"); return id.replace("__", "_dus_"); //doubleunderscore is reserved in glsl } diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index f43943bdff2..4e4d896bd7e 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -166,7 +166,7 @@ static String _opstr(SL::Operator p_op) { static String _mkid(const String &p_id) { - String id = "m_" + p_id; + String id = "m_" + p_id.replace("__", "_dus_"); return id.replace("__", "_dus_"); //doubleunderscore is reserved in glsl } From b2ac2b6201ab684d5a7d23a332e8330b5746aeaf Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Fri, 31 Jan 2020 16:24:09 +0100 Subject: [PATCH 05/32] Fixed LineEdit virtual keyboard inputs on Android Changed the condition to add a length filter to make it consistent with the documentation (0 means no character limit). Otherwise the default value in LineEdit causes the virtual keyboard to be non-fonctional on Android. (cherry picked from commit 196860508a79838ed5ccc428e9a5054d29ee366d) --- .../java/lib/src/org/godotengine/godot/input/GodotEditText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java index 44998aa6c08..e901b4b36d0 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java @@ -123,7 +123,7 @@ public class GodotEditText extends EditText { } private void setMaxInputLength(EditText p_edit_text, int p_max_input_length) { - if (p_max_input_length >= 0) { + if (p_max_input_length > 0) { InputFilter[] filters = new InputFilter[1]; filters[0] = new InputFilter.LengthFilter(p_max_input_length); p_edit_text.setFilters(filters); From 72f7e4efe09a77d0f4a6ca0cadeccd4fac55a92c Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Fri, 31 Jan 2020 19:34:34 +0300 Subject: [PATCH 06/32] Fix canvas_item light alpha output in visual shaders (cherry picked from commit b822da00f8fe65eed1dfcf918472fb7ddf872696) --- scene/resources/visual_shader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index e350a0a99ea..08d95420414 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -1890,7 +1890,7 @@ const VisualShaderNodeOutput::Port VisualShaderNodeOutput::ports[] = { { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_FRAGMENT, VisualShaderNode::PORT_TYPE_SCALAR, "normalmap_depth", "NORMALMAP_DEPTH" }, // Canvas Item, Light { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR, "light", "LIGHT.rgb" }, - { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_SCALAR, "light_alpha", "LIGHT.rgb" }, + { Shader::MODE_CANVAS_ITEM, VisualShader::TYPE_LIGHT, VisualShaderNode::PORT_TYPE_SCALAR, "light_alpha", "LIGHT.a" }, // Particles, Vertex { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_VECTOR, "color", "COLOR.rgb" }, { Shader::MODE_PARTICLES, VisualShader::TYPE_VERTEX, VisualShaderNode::PORT_TYPE_SCALAR, "alpha", "COLOR.a" }, From 0995696e084f43217bd6935f7f98a08b6e272439 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sat, 1 Feb 2020 12:34:02 +0300 Subject: [PATCH 07/32] Prevent shader crash when name conflict with "dus" and "__" occured (cherry picked from commit 2c4367441cf00442b9e841d98feefb99fc06ab75) --- servers/visual/shader_language.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index d3ecdf4e596..14d2f6d0862 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -662,6 +662,8 @@ ShaderLanguage::Token ShaderLanguage::_get_token() { idx++; } + str = str.replace("dus_", "_"); + return _make_token(TK_IDENTIFIER, str); } From dc20acd4fc60dfb66147709fd4fe14dd42398664 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 3 Feb 2020 13:59:13 +0800 Subject: [PATCH 08/32] Updates Path2D in debugging if navigation is visible (cherry picked from commit 00d578ba3e44f38c8d65715a590b05592f6c148d) --- scene/2d/path_2d.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 6ae008548e0..ef7c343c1a8 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -120,9 +120,15 @@ void Path2D::_notification(int p_what) { } void Path2D::_curve_changed() { + if (!is_inside_tree()) { + return; + } - if (is_inside_tree() && Engine::get_singleton()->is_editor_hint()) - update(); + if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_navigation_hint()) { + return; + } + + update(); } void Path2D::set_curve(const Ref &p_curve) { From 8c689f7d4ae447e0c7ee70c17ea27b4f3e904a26 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Mon, 3 Feb 2020 17:15:24 +0300 Subject: [PATCH 09/32] Fix restoring window from fullscreen to normal on Linux (cherry picked from commit 8737269275c371c8d56fcb56d783f8df1aaa2b88) --- platform/x11/os_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 57c7b0594c1..8195006121f 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1429,7 +1429,7 @@ void OS_X11::set_window_fullscreen(bool p_enabled) { set_window_maximized(true); } set_wm_fullscreen(p_enabled); - if (!p_enabled && !current_videomode.always_on_top) { + if (!p_enabled && current_videomode.always_on_top) { // Restore set_window_maximized(false); } From e8474435e57d07a3b81dc860da94ea3f59c989ae Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Mon, 3 Feb 2020 18:14:41 +0300 Subject: [PATCH 10/32] Restores correct window position after fullscreen toggling off on Linux (cherry picked from commit 90f00c0813b8335605c81b5d5063922efe5519e3) --- platform/x11/os_x11.cpp | 7 ++++++- platform/x11/os_x11.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 8195006121f..e40aa867f88 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1433,7 +1433,11 @@ void OS_X11::set_window_fullscreen(bool p_enabled) { // Restore set_window_maximized(false); } - + if (!p_enabled) { + set_window_position(last_position_before_fs); + } else { + last_position_before_fs = get_window_position(); + } current_videomode.fullscreen = p_enabled; } @@ -3502,4 +3506,5 @@ OS_X11::OS_X11() { window_focused = true; xim_style = 0L; mouse_mode = MOUSE_MODE_VISIBLE; + last_position_before_fs = Vector2(); } diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 01e5aac3dfc..25b406743b4 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -115,6 +115,7 @@ class OS_X11 : public OS_Unix { // IME bool im_active; Vector2 im_position; + Vector2 last_position_before_fs; Size2 min_size; Size2 max_size; From 3317f7640ed8a871f932b8a62997bafcca2d4f5b Mon Sep 17 00:00:00 2001 From: D00T24 Date: Mon, 3 Feb 2020 20:40:10 +0400 Subject: [PATCH 11/32] fixed godot not recognising 150x150 icon for uwp export (cherry picked from commit 88bd3227aced00d775c11aa888564064b0c41bb0) --- platform/uwp/export/export.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 57fb9004b8b..37fc6fb456e 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1176,7 +1176,7 @@ public: err += TTR("Invalid square 71x71 logo image dimensions (should be 71x71).") + "\n"; } - if (!p_preset->get("images/square150x150_logo").is_zero() && !_valid_image((Object::cast_to((Object *)p_preset->get("images/square150x150_logo"))), 150, 0)) { + if (!p_preset->get("images/square150x150_logo").is_zero() && !_valid_image((Object::cast_to((Object *)p_preset->get("images/square150x150_logo"))), 150, 150)) { valid = false; err += TTR("Invalid square 150x150 logo image dimensions (should be 150x150).") + "\n"; } From a779774c864c712c5b2638a434a7b3d48a708a4f Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Tue, 4 Feb 2020 16:09:59 -0300 Subject: [PATCH 12/32] Hide TileSet's properties from the inspector (cherry picked from commit 5452028d55e09d166945a1d0dffd288af92064d9) --- scene/resources/tile_set.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 555e90ed3c1..db5037172e9 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -325,14 +325,14 @@ void TileSet::_get_property_list(List *p_list) const { int id = E->key(); String pre = itos(id) + "/"; - p_list->push_back(PropertyInfo(Variant::STRING, pre + "name")); - p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture")); - p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture")); - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "tex_offset")); - p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial")); - p_list->push_back(PropertyInfo(Variant::COLOR, pre + "modulate")); - p_list->push_back(PropertyInfo(Variant::RECT2, pre + "region")); - p_list->push_back(PropertyInfo(Variant::INT, pre + "tile_mode", PROPERTY_HINT_ENUM, "SINGLE_TILE,AUTO_TILE,ATLAS_TILE")); + p_list->push_back(PropertyInfo(Variant::STRING, pre + "name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "tex_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::COLOR, pre + "modulate", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::RECT2, pre + "region", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::INT, pre + "tile_mode", PROPERTY_HINT_ENUM, "SINGLE_TILE,AUTO_TILE,ATLAS_TILE", PROPERTY_USAGE_NOEDITOR)); if (tile_get_tile_mode(id) == AUTO_TILE) { p_list->push_back(PropertyInfo(Variant::INT, pre + "autotile/bitmask_mode", PROPERTY_HINT_ENUM, "2X2,3X3 (minimal),3X3", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/bitmask_flags", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); @@ -352,17 +352,17 @@ void TileSet::_get_property_list(List *p_list) const { p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/priority_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/z_index_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "occluder_offset")); - p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "occluder", PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D")); - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "navigation_offset")); - p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "navigation", PROPERTY_HINT_RESOURCE_TYPE, "NavigationPolygon")); - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "shape_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); - p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D", PROPERTY_USAGE_EDITOR)); - p_list->push_back(PropertyInfo(Variant::BOOL, pre + "shape_one_way", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); - p_list->push_back(PropertyInfo(Variant::REAL, pre + "shape_one_way_margin", PROPERTY_HINT_RANGE, "0,128,0.01", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "occluder_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "occluder", PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "navigation_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "navigation", PROPERTY_HINT_RESOURCE_TYPE, "NavigationPolygon", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "shape_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::BOOL, pre + "shape_one_way", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::REAL, pre + "shape_one_way_margin", PROPERTY_HINT_RANGE, "0,128,0.01", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "shapes", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); - p_list->push_back(PropertyInfo(Variant::INT, pre + "z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1")); + p_list->push_back(PropertyInfo(Variant::INT, pre + "z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1", PROPERTY_USAGE_NOEDITOR)); } } From 5765154ff2a5783a0a021028bac3b1e3fc706e44 Mon Sep 17 00:00:00 2001 From: Fabio Iotti Date: Tue, 4 Feb 2020 21:11:38 +0000 Subject: [PATCH 13/32] Fix empty audio infinite loop (cherry picked from commit 5ed4ad81c3892c73bd53abffe98dc5910f04c23c) --- modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index b80b126bde2..f2d0f5c9a64 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -57,7 +57,7 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra if (todo) { //end of file! - if (vorbis_stream->loop) { + if (vorbis_stream->loop && mixed > 0) { //loop seek(vorbis_stream->loop_offset); loops++; From 15315f118ccd0a462eafa01801570c0dd887ca4d Mon Sep 17 00:00:00 2001 From: Georg Wacker Date: Mon, 21 Oct 2019 16:52:45 +0200 Subject: [PATCH 14/32] Fix control node transform animation jitter with pivot offset The workaround for moving the pivot is not needed anymore, in fact it causes all transforms applied to control nodes to jitter while animating (if a pivot offset is set). This can be observed via AnimationPlayer and Tween. The fix is to remove the obsolete workaround that causes this bug. Fixes #28804 (cherry picked from commit dfb7d46a2aaf9bef2c7dd067e699e70291062fb6) --- scene/gui/control.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ae48a1356e6..4c70bd1d394 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -462,11 +462,6 @@ void Control::_update_canvas_item_transform() { Transform2D xform = _get_internal_transform(); xform[2] += get_position(); - // We use a little workaround to avoid flickering when moving the pivot with _edit_set_pivot() - if (is_inside_tree() && Math::abs(Math::sin(data.rotation * 4.0f)) < 0.00001f && get_viewport()->is_snap_controls_to_pixels_enabled()) { - xform[2] = xform[2].round(); - } - VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), xform); } From 621821bf8768d71cca500bdde3604569dc2557f4 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Fri, 15 Nov 2019 09:47:27 -0300 Subject: [PATCH 15/32] Make the replaced results appear in the matches counter (cherry picked from commit 1c5cfb9bfda192a37c00e4d6b2b4ef8c5d8c35c9) --- editor/code_editor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 4f684c7bdc7..e05ace53daa 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -277,7 +277,8 @@ void FindReplaceBar::_replace_all() { } text_edit->set_v_scroll(vsval); - set_error(vformat(TTR("Replaced %d occurrence(s)."), rc)); + matches_label->add_color_override("font_color", rc > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor")); + matches_label->set_text(vformat(TTR("%d replaced."), rc)); text_edit->call_deferred("connect", "text_changed", this, "_editor_text_changed"); results_count = -1; From 98b4ef274b961f451fb5a153b3de3be6a9e2ff98 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Wed, 8 Jan 2020 20:25:13 -0300 Subject: [PATCH 16/32] Make ScriptCreateDialog's script valid message a bit more clearer (cherry picked from commit 14e36c72b0b665c80d55d2138c7adad4d202ec13) --- editor/script_create_dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 35d5fe5f70d..a982724d4cb 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -644,7 +644,7 @@ void ScriptCreateDialog::_update_dialog() { } if (script_ok) { - _msg_script_valid(true, TTR("Script is valid.")); + _msg_script_valid(true, TTR("Script path/name is valid.")); } // Does script have named classes? From 611cc11536483acdc96b7f9b0712a256dff1c0d7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 22 Jan 2020 22:18:02 +0100 Subject: [PATCH 17/32] Only emit the JavaScript support code for Web when building for HTML5 Excluding other unused environments like Node.js makes the support code about 4 KB smaller. (cherry picked from commit e818b51f32a96b5d27c70075f048bbfe1442243c) --- platform/javascript/detect.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 7bf3e1bc1df..17668333647 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -131,6 +131,11 @@ def configure(env): env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) + # Only include the JavaScript support code for the web environment + # (i.e. exclude Node.js and other unused environments). + # This makes the JavaScript support code about 4 KB smaller. + env.Append(LINKFLAGS=['-s', 'ENVIRONMENT=web']) + # This needs to be defined for Emscripten using 'fastcomp' (default pre-1.39.0) # and undefined if using 'upstream'. And to make things simple, earlier # Emscripten versions didn't include 'fastcomp' in their path, so we check From 6e56d04616b1c88cdf8398eb6330d8880ed5e119 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 24 Jan 2020 12:07:38 +0100 Subject: [PATCH 18/32] Display times as milliseconds in the profiler and performance monitors Small values are easier to read as milliseconds compared to seconds. (cherry picked from commit f1d9dbfb08e57a2f931d6e4de9b39c1cbf8c65d2) --- editor/editor_profiler.cpp | 30 +++++++++++++----------------- editor/script_editor_debugger.cpp | 20 ++++++++++---------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 4807f8839c4..3fdeaff19d9 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -102,26 +102,28 @@ void EditorProfiler::clear() { } static String _get_percent_txt(float p_value, float p_total) { - if (p_total == 0) + if (p_total == 0) { p_total = 0.00001; + } + return String::num((p_value / p_total) * 100, 1) + "%"; } String EditorProfiler::_get_time_as_text(const Metric &m, float p_time, int p_calls) { - int dmode = display_mode->get_selected(); + const int dmode = display_mode->get_selected(); if (dmode == DISPLAY_FRAME_TIME) { - return rtos(p_time); + return rtos(p_time * 1000).pad_decimals(2) + " ms"; } else if (dmode == DISPLAY_AVERAGE_TIME) { - if (p_calls == 0) - return "0"; - else - return rtos(p_time / p_calls); + if (p_calls == 0) { + return "0.00 ms"; + } else { + return rtos((p_time / p_calls) * 1000).pad_decimals(2) + " ms"; + } } else if (dmode == DISPLAY_FRAME_PERCENT) { return _get_percent_txt(p_time, m.frame_time); } else if (dmode == DISPLAY_PHYSICS_FRAME_PERCENT) { - return _get_percent_txt(p_time, m.physics_frame_time); } @@ -729,7 +731,7 @@ EditorProfiler::EditorProfiler() { h_split->set_v_size_flags(SIZE_EXPAND_FILL); variables = memnew(Tree); - variables->set_custom_minimum_size(Size2(300, 0) * EDSCALE); + variables->set_custom_minimum_size(Size2(320, 0) * EDSCALE); variables->set_hide_folding(true); h_split->add_child(variables); variables->set_hide_root(true); @@ -737,10 +739,10 @@ EditorProfiler::EditorProfiler() { variables->set_column_titles_visible(true); variables->set_column_title(0, TTR("Name")); variables->set_column_expand(0, true); - variables->set_column_min_width(0, 60); + variables->set_column_min_width(0, 60 * EDSCALE); variables->set_column_title(1, TTR("Time")); variables->set_column_expand(1, false); - variables->set_column_min_width(1, 60 * EDSCALE); + variables->set_column_min_width(1, 100 * EDSCALE); variables->set_column_title(2, TTR("Calls")); variables->set_column_expand(2, false); variables->set_column_min_width(2, 60 * EDSCALE); @@ -749,7 +751,6 @@ EditorProfiler::EditorProfiler() { graph = memnew(TextureRect); graph->set_expand(true); graph->set_mouse_filter(MOUSE_FILTER_STOP); - //graph->set_ignore_mouse(false); graph->connect("draw", this, "_graph_tex_draw"); graph->connect("gui_input", this, "_graph_tex_input"); graph->connect("mouse_exited", this, "_graph_tex_mouse_exit"); @@ -760,13 +761,10 @@ EditorProfiler::EditorProfiler() { int metric_size = CLAMP(int(EDITOR_DEF("debugger/profiler_frame_history_size", 600)), 60, 1024); frame_metrics.resize(metric_size); last_metric = -1; - //cursor_metric=-1; hover_metric = -1; EDITOR_DEF("debugger/profiler_frame_max_functions", 64); - //display_mode=DISPLAY_FRAME_TIME; - frame_delay = memnew(Timer); frame_delay->set_wait_time(0.1); frame_delay->set_one_shot(true); @@ -784,6 +782,4 @@ EditorProfiler::EditorProfiler() { seeking = false; graph_height = 1; - - //activate->set_disabled(true); } diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 71a946b256c..182124b1414 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -806,25 +806,25 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da p.write[i] = arr[i]; if (i < perf_items.size()) { - float v = p[i]; - String vs = rtos(v); - String tt = vs; + const float value = p[i]; + String label = rtos(value); + String tooltip = label; switch (Performance::MonitorType((int)perf_items[i]->get_metadata(1))) { case Performance::MONITOR_TYPE_MEMORY: { - vs = String::humanize_size(v); - tt = vs; + label = String::humanize_size(value); + tooltip = label; } break; case Performance::MONITOR_TYPE_TIME: { - tt += " seconds"; - vs += " s"; + label = rtos(value * 1000).pad_decimals(2) + " ms"; + tooltip = label; } break; default: { - tt += " " + perf_items[i]->get_text(0); + tooltip += " " + perf_items[i]->get_text(0); } break; } - perf_items[i]->set_text(1, vs); - perf_items[i]->set_tooltip(1, tt); + perf_items[i]->set_text(1, label); + perf_items[i]->set_tooltip(1, tooltip); if (p[i] > perf_max[i]) perf_max.write[i] = p[i]; } From 74bf8b2d50c975ed67586196096441d870255e08 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 24 Jan 2020 12:18:00 +0100 Subject: [PATCH 19/32] Allow saving anywhere when exporting CSV measures from the profiler Previously, the CSV file could only be saved in `res://`. Since this is an editor tool, it makes sense to allow saving anywhere on the filesystem. (cherry picked from commit 81f33df84b8f72d633081cdf2c7b8cd5700d9c87) --- editor/script_editor_debugger.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 182124b1414..004c7a68014 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1622,6 +1622,7 @@ void ScriptEditorDebugger::_output_clear() { void ScriptEditorDebugger::_export_csv() { file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); + file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); file_dialog_mode = SAVE_CSV; file_dialog->popup_centered_ratio(); } From 3388b7f4c74fb673550ebc694b6a3d9a42d23929 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 29 Jan 2020 13:12:38 +0800 Subject: [PATCH 20/32] Adds sanitizer options for macOS (cherry picked from commit df4ea84e03b9d1f4397860c562084558a8f062f7) --- platform/osx/detect.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 7882253e7aa..fe839199e81 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -27,6 +27,9 @@ def get_opts(): ('MACOS_SDK_PATH', 'Path to the macOS SDK', ''), EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')), BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False), + BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), + BoolVariable('use_asan', 'Use LLVM/GCC compiler address sanitizer (ASAN))', False), + BoolVariable('use_tsan', 'Use LLVM/GCC compiler thread sanitizer (TSAN))', False), ] @@ -122,6 +125,21 @@ def configure(env): env["CC"] = "clang" env["LINK"] = "clang++" + if env['use_ubsan'] or env['use_asan'] or env['use_tsan']: + env.extra_suffix += "s" + + if env['use_ubsan']: + env.Append(CCFLAGS=['-fsanitize=undefined']) + env.Append(LINKFLAGS=['-fsanitize=undefined']) + + if env['use_asan']: + env.Append(CCFLAGS=['-fsanitize=address']) + env.Append(LINKFLAGS=['-fsanitize=address']) + + if env['use_tsan']: + env.Append(CCFLAGS=['-fsanitize=thread']) + env.Append(LINKFLAGS=['-fsanitize=thread']) + ## Dependencies if env['builtin_libtheora']: From 7487a2d11af6755d293fb96a4b7b67c72a488252 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 30 Jan 2020 03:05:48 +0100 Subject: [PATCH 21/32] Use the editor background color for the profiler graph This leads to a better appearance compared to using pure black. (cherry picked from commit fa2fda324476d9384f86773d1e4bc17ff4f8b05e) --- editor/editor_profiler.cpp | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 3fdeaff19d9..e5a9c4d6991 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -165,12 +165,10 @@ void EditorProfiler::_item_edited() { void EditorProfiler::_update_plot() { - int w = graph->get_size().width; - int h = graph->get_size().height; - + const int w = graph->get_size().width; + const int h = graph->get_size().height; bool reset_texture = false; - - int desired_len = w * h * 4; + const int desired_len = w * h * 4; if (graph_image.size() != desired_len) { reset_texture = true; @@ -178,18 +176,19 @@ void EditorProfiler::_update_plot() { } PoolVector::Write wr = graph_image.write(); + const Color background_color = get_color("dark_color_2", "Editor"); - //clear + // Clear the previous frame and set the background color. for (int i = 0; i < desired_len; i += 4) { - wr[i + 0] = 0; - wr[i + 1] = 0; - wr[i + 2] = 0; + wr[i + 0] = Math::fast_ftoi(background_color.r * 255); + wr[i + 1] = Math::fast_ftoi(background_color.g * 255); + wr[i + 2] = Math::fast_ftoi(background_color.b * 255); wr[i + 3] = 255; } //find highest value - bool use_self = display_time->get_selected() == DISPLAY_SELF_TIME; + const bool use_self = display_time->get_selected() == DISPLAY_SELF_TIME; float highest = 0; for (int i = 0; i < frame_metrics.size(); i++) { @@ -321,21 +320,23 @@ void EditorProfiler::_update_plot() { for (int j = 0; j < h * 4; j += 4) { - int a = column[j + 3]; + const int a = column[j + 3]; if (a > 0) { column[j + 0] /= a; column[j + 1] /= a; column[j + 2] /= a; } - uint8_t r = uint8_t(column[j + 0]); - uint8_t g = uint8_t(column[j + 1]); - uint8_t b = uint8_t(column[j + 2]); + const uint8_t red = uint8_t(column[j + 0]); + const uint8_t green = uint8_t(column[j + 1]); + const uint8_t blue = uint8_t(column[j + 2]); + const bool is_filled = red >= 1 || green >= 1 || blue >= 1; + const int widx = ((j >> 2) * w + i) * 4; - int widx = ((j >> 2) * w + i) * 4; - wr[widx + 0] = r; - wr[widx + 1] = g; - wr[widx + 2] = b; + // If the pixel isn't filled by any profiler line, apply the background color instead. + wr[widx + 0] = is_filled ? red : Math::fast_ftoi(background_color.r * 255); + wr[widx + 1] = is_filled ? green : Math::fast_ftoi(background_color.g * 255); + wr[widx + 2] = is_filled ? blue : Math::fast_ftoi(background_color.b * 255); wr[widx + 3] = 255; } } From cbd4784d1465d66b7159d9b49d101ce399b9c787 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 30 Jan 2020 20:02:27 +0100 Subject: [PATCH 22/32] Improve the CheckBox and CheckButton class documentations This makes the CheckBox and CheckButton classes 100% documented. (cherry picked from commit c9946bc87e269a2733fa28885ed305b381a5f909) --- doc/classes/CheckBox.xml | 23 ++++++++++++++++++++--- doc/classes/CheckButton.xml | 23 ++++++++++++++++++++--- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 5ba159880e5..b5c7332bc14 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -1,10 +1,10 @@ - Binary choice user interface widget. + Binary choice user interface widget. See also [CheckButton]. - A checkbox allows the user to make a binary choice (choosing only one of two possible options). + A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to [CheckButton] in functionality, but it has a different apperance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has [b]no[/b] immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed. @@ -18,41 +18,58 @@ - The vertical offset used when rendering the check icons. + The vertical offset used when rendering the check icons (in pixels). + The check icon to display when the [CheckBox] is checked. + The [StyleBox] to display as a background when the [CheckBox] is disabled. + The [StyleBox] to display as a background when the [CheckBox] is focused. + The [Font] to use for the [CheckBox] text. + The [CheckBox] text's font color. + The [CheckBox] text's font color when it's disabled. + The [CheckBox] text's font color when it's hovered. + The [CheckBox] text's font color when it's hovered and pressed. + The [CheckBox] text's font color when it's pressed. + The [StyleBox] to display as a background when the [CheckBox] is hovered. + The [StyleBox] to display as a background when the [CheckBox] is hovered and pressed. + The separation between the check icon and the text (in pixels). + The [StyleBox] to display as a background. + The [StyleBox] to display as a background when the [CheckBox] is pressed. + If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is checked. + If the [CheckBox] is configured as a radio button, the icon to display when the [CheckBox] is unchecked. + The check icon to display when the [CheckBox] is unchecked. diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index e6a890b21fe..769acb5d16a 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -1,10 +1,10 @@ - Checkable button. + Checkable button. See also [CheckBox]. - CheckButton is a toggle button displayed as a check field. + CheckButton is a toggle button displayed as a check field. It's similar to [CheckBox] in functionality, but it has a different apperance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an [b]immediate[/b] effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. @@ -18,41 +18,58 @@ - The vertical offset used when rendering the icons. + The vertical offset used when rendering the toggle icons (in pixels). + The [StyleBox] to display as a background when the [CheckButton] is disabled. + The [StyleBox] to display as a background when the [CheckButton] is focused. + The [Font] to use for the [CheckButton] text. + The [CheckButton] text's font color. + The [CheckButton] text's font color when it's disabled. + The [CheckButton] text's font color when it's hovered. + The [CheckButton] text's font color when it's hovered and pressed. + The [CheckButton] text's font color when it's pressed. + The [StyleBox] to display as a background when the [CheckButton] is hovered. + The [StyleBox] to display as a background when the [CheckButton] is hovered and pressed. + The separation between the toggle icon and the text (in pixels). + The [StyleBox] to display as a background. + The icon to display when the [CheckButton] is unchecked. + The icon to display when the [CheckButton] is unchecked and disabled. + The icon to display when the [CheckButton] is checked. + The icon to display when the [CheckButton] is checked and disabled. + The [StyleBox] to display as a background when the [CheckButton] is pressed. From 1898240af8cc460b4b11ceb74ef5c6bd9e61d41c Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 30 Jan 2020 23:49:17 +0100 Subject: [PATCH 23/32] Increase the maximum number of octaves in OpenSimplexNoise to 9 An error message is now printed when trying to set the number of octaves above the maximum allowed value. The magic constant was also replaced with a define that can be easily changed. This closes #28714. (cherry picked from commit 13622d40fc22e2b3be90d1b6f3c78e4b05f7ca1f) --- modules/opensimplex/doc_classes/OpenSimplexNoise.xml | 3 ++- modules/opensimplex/open_simplex_noise.cpp | 9 ++++++--- modules/opensimplex/open_simplex_noise.h | 7 ++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/opensimplex/doc_classes/OpenSimplexNoise.xml b/modules/opensimplex/doc_classes/OpenSimplexNoise.xml index f4f54901fb3..f500925f759 100644 --- a/modules/opensimplex/doc_classes/OpenSimplexNoise.xml +++ b/modules/opensimplex/doc_classes/OpenSimplexNoise.xml @@ -117,7 +117,8 @@ Difference in period between [member octaves]. - Number of OpenSimplex noise layers that are sampled to get the fractal noise. + Number of OpenSimplex noise layers that are sampled to get the fractal noise. Higher values result in more detailed noise but take more time to generate. + [b]Note:[/b] The maximum allowed value is 9. Period of the base octave. A lower period results in a higher-frequency noise (more value changes across the same distance). diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp index c99588aefac..bd187e6b5b6 100644 --- a/modules/opensimplex/open_simplex_noise.cpp +++ b/modules/opensimplex/open_simplex_noise.cpp @@ -47,7 +47,7 @@ OpenSimplexNoise::~OpenSimplexNoise() { } void OpenSimplexNoise::_init_seeds() { - for (int i = 0; i < 6; ++i) { + for (int i = 0; i < MAX_OCTAVES; ++i) { open_simplex_noise(seed + i * 2, &(contexts[i])); } } @@ -71,7 +71,10 @@ int OpenSimplexNoise::get_seed() { void OpenSimplexNoise::set_octaves(int p_octaves) { if (p_octaves == octaves) return; - octaves = CLAMP(p_octaves, 1, 6); + + ERR_FAIL_COND_MSG(p_octaves > MAX_OCTAVES, vformat("The number of OpenSimplexNoise octaves is limited to %d; ignoring the new value.", MAX_OCTAVES)); + + octaves = CLAMP(p_octaves, 1, MAX_OCTAVES); emit_changed(); } @@ -182,7 +185,7 @@ void OpenSimplexNoise::_bind_methods() { ClassDB::bind_method(D_METHOD("get_noise_3dv", "pos"), &OpenSimplexNoise::get_noise_3dv); ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "octaves", PROPERTY_HINT_RANGE, "1,6,1"), "set_octaves", "get_octaves"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "octaves", PROPERTY_HINT_RANGE, vformat("1,%d,1", MAX_OCTAVES)), "set_octaves", "get_octaves"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "persistence", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistence", "get_persistence"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity"); diff --git a/modules/opensimplex/open_simplex_noise.h b/modules/opensimplex/open_simplex_noise.h index 89b12253b98..dce62bc1f95 100644 --- a/modules/opensimplex/open_simplex_noise.h +++ b/modules/opensimplex/open_simplex_noise.h @@ -37,11 +37,16 @@ #include "thirdparty/misc/open-simplex-noise.h" +// The maximum number of octaves allowed. Note that these are statically allocated. +// Higher values become exponentially slower, so this shouldn't be set too high +// to avoid freezing the editor for long periods of time. +#define MAX_OCTAVES 9 + class OpenSimplexNoise : public Resource { GDCLASS(OpenSimplexNoise, Resource); OBJ_SAVE_TYPE(OpenSimplexNoise); - osn_context contexts[6]; + osn_context contexts[MAX_OCTAVES]; int seed; float persistence; // Controls details, value in [0,1]. Higher increases grain, lower increases smoothness. From 0d8b3efeb73dc94a18dc2d3f124380417d6d38b3 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 31 Jan 2020 12:40:13 +0800 Subject: [PATCH 24/32] Adds extra cursors for macOS Before, plain arrow cursor or unsuitable ones were used. (cherry picked from commit 8f881847c05b596e587f87cc682ce0307a52af34) --- platform/osx/os_osx.mm | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 6a214b8669b..53fe11b3bb5 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -115,6 +115,20 @@ static Vector2 get_mouse_pos(NSPoint locationInWindow, CGFloat backingScaleFacto return Vector2(mouse_x, mouse_y); } +static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) { + if ([NSCursor respondsToSelector:selector]) { + id object = [NSCursor performSelector:selector]; + if ([object isKindOfClass:[NSCursor class]]) { + return object; + } + } + if (fallback) { + // Fallback should be a reasonable default, no need to check. + return [NSCursor performSelector:fallback]; + } + return [NSCursor arrowCursor]; +} + @interface GodotApplication : NSApplication @end @@ -1813,15 +1827,15 @@ void OS_OSX::set_cursor_shape(CursorShape p_shape) { case CURSOR_BUSY: [[NSCursor arrowCursor] set]; break; case CURSOR_DRAG: [[NSCursor closedHandCursor] set]; break; case CURSOR_CAN_DROP: [[NSCursor openHandCursor] set]; break; - case CURSOR_FORBIDDEN: [[NSCursor arrowCursor] set]; break; - case CURSOR_VSIZE: [[NSCursor resizeUpDownCursor] set]; break; - case CURSOR_HSIZE: [[NSCursor resizeLeftRightCursor] set]; break; - case CURSOR_BDIAGSIZE: [[NSCursor arrowCursor] set]; break; - case CURSOR_FDIAGSIZE: [[NSCursor arrowCursor] set]; break; + case CURSOR_FORBIDDEN: [[NSCursor operationNotAllowedCursor] set]; break; + case CURSOR_VSIZE: [cursorFromSelector(@selector(_windowResizeNorthSouthCursor), @selector(resizeUpDownCursor)) set]; break; + case CURSOR_HSIZE: [cursorFromSelector(@selector(_windowResizeEastWestCursor), @selector(resizeLeftRightCursor)) set]; break; + case CURSOR_BDIAGSIZE: [cursorFromSelector(@selector(_windowResizeNorthEastSouthWestCursor)) set]; break; + case CURSOR_FDIAGSIZE: [cursorFromSelector(@selector(_windowResizeNorthWestSouthEastCursor)) set]; break; case CURSOR_MOVE: [[NSCursor arrowCursor] set]; break; case CURSOR_VSPLIT: [[NSCursor resizeUpDownCursor] set]; break; case CURSOR_HSPLIT: [[NSCursor resizeLeftRightCursor] set]; break; - case CURSOR_HELP: [[NSCursor arrowCursor] set]; break; + case CURSOR_HELP: [cursorFromSelector(@selector(_helpCursor)) set]; break; default: { }; } From 3410dd3a9e5350c3719a0e52ca56bd2b9811242d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 31 Jan 2020 17:56:03 +0100 Subject: [PATCH 25/32] doc: Add a short AnimationPlayer versus Tween comparison Many newcomers are confused about which one to choose for animating properties. This should help clarify the situation with regards to AnimationPlayer versus Tween. (cherry picked from commit 810b1341cef475c28c97cc476f54e1199f5c3d2d) --- doc/classes/AnimationPlayer.xml | 1 + doc/classes/Tween.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 8bc2c34c6d0..bb1754b810b 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -5,6 +5,7 @@ An animation player is used for general-purpose playback of [Animation] resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels. + [AnimationPlayer] is more suited than [Tween] for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an [AnimationPlayer] node thanks to the animation tools provided by the editor. That particular example can also be implemented with a [Tween] node, but it requires doing everything by code. Updating the target properties of animations occurs at process time. diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index 9345cd059a1..97d436c7070 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -5,6 +5,7 @@ Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name [i]tween[/i] comes from [i]in-betweening[/i], an animation technique where you specify [i]keyframes[/i] and the computer interpolates the frames that appear between them. + [Tween] is more suited than [AnimationPlayer] for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a [Tween] node; it would be difficult to do the same thing with an [AnimationPlayer] node. Here is a brief usage example that causes a 2D node to move smoothly between two positions: [codeblock] var tween = get_node("Tween") From 47368f2b7ccd930c7f9ecadf0e9369d681365bf2 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 31 Jan 2020 21:19:17 +0100 Subject: [PATCH 26/32] doc: Add an example for `Array.sort()` This may help people understand the difference between alphabetical and natural order more quickly. (cherry picked from commit 1de9118c5fee6201ea1e9eb4be9b00867f536520) --- doc/classes/Array.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 5f100d918e1..89ad8e17db0 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -322,7 +322,12 @@ Sorts the array. - [b]Note:[/b] strings are sorted in alphabetical, not natural order. + [b]Note:[/b] Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example: + [codeblock] + var strings = ["string1", "string2", "string10", "string11"] + strings.sort() + print(strings) # Prints [string1, string10, string11, string2] + [/codeblock] From 11f012d2dbfb33fa44a819d9c7d92159ebe9dbf4 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 4 Feb 2020 15:46:01 +0800 Subject: [PATCH 27/32] Completes doc for button classes (cherry picked from commit db42d5ddffd707017097cc864b0015a11e2fc81e) --- doc/classes/ColorPickerButton.xml | 12 ++++++++++++ doc/classes/LinkButton.xml | 8 ++++++++ doc/classes/MenuButton.xml | 11 +++++++++++ doc/classes/OptionButton.xml | 13 +++++++++++++ doc/classes/ToolButton.xml | 2 +- 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index 24a3d2b053c..7fcd47f875d 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -56,28 +56,40 @@ + The background of the color preview rect on the button. + [StyleBox] used when the [ColorPickerButton] is disabled. + [StyleBox] used when the [ColorPickerButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [Font] of the [ColorPickerButton]'s text. + Default text [Color] of the [ColorPickerButton]. + Text [Color] used when the [ColorPickerButton] is disabled. + Text [Color] used when the [ColorPickerButton] is being hovered. + Text [Color] used when the [ColorPickerButton] is being pressed. + [StyleBox] used when the [ColorPickerButton] is being hovered. + The horizontal space between [ColorPickerButton]'s icon and text. + Default [StyleBox] for the [ColorPickerButton]. + [StyleBox] used when the [ColorPickerButton] is being pressed. diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 243c4618b63..6ad354587f7 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -15,8 +15,10 @@ + The button's text that will be displayed inside the button's area. + Determines when to show the underline. See [enum UnderlineMode] for options. @@ -32,16 +34,22 @@ + [StyleBox] used when the [LinkButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [Font] of the [LinkButton]'s text. + Default text [Color] of the [LinkButton]. + Text [Color] used when the [LinkButton] is being hovered. + Text [Color] used when the [LinkButton] is being pressed. + The vertical space between the baseline of text and the underline. diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index f3ea2862608..8395cef8147 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -48,26 +48,37 @@ + [StyleBox] used when the [MenuButton] is disabled. + [StyleBox] used when the [MenuButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [Font] of the [MenuButton]'s text. + Default text [Color] of the [MenuButton]. + Text [Color] used when the [MenuButton] is disabled. + Text [Color] used when the [MenuButton] is being hovered. + Text [Color] used when the [MenuButton] is being pressed. + [StyleBox] used when the [MenuButton] is being hovered. + The horizontal space between [MenuButton]'s icon and text. + Default [StyleBox] for the [MenuButton]. + [StyleBox] used when the [MenuButton] is being pressed. diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 54f7749ec4a..d379122b75e 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -232,30 +232,43 @@ + The arrow icon to be drawn on the right end of the button. + The horizontal space between the arrow icon and the right edge of the button. + [StyleBox] used when the [OptionButton] is disabled. + [StyleBox] used when the [OptionButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. + [Font] of the [OptionButton]'s text. + Default text [Color] of the [OptionButton]. + Text [Color] used when the [OptionButton] is disabled. + Text [Color] used when the [OptionButton] is being hovered. + Text [Color] used when the [OptionButton] is being pressed. + [StyleBox] used when the [OptionButton] is being hovered. + The horizontal space between [OptionButton]'s icon and text. + Default [StyleBox] for the [OptionButton]. + [StyleBox] used when the [OptionButton] is being pressed. diff --git a/doc/classes/ToolButton.xml b/doc/classes/ToolButton.xml index 6a5ab52608b..8b2029ed2af 100644 --- a/doc/classes/ToolButton.xml +++ b/doc/classes/ToolButton.xml @@ -24,7 +24,7 @@ [StyleBox] used when the [ToolButton] is disabled. - [StyleBox] used when the [ToolButton] is focused. It is displayed over the current [StyleBox], so using [StyleboxEmpty] will just disable the focus visual effect. + [StyleBox] used when the [ToolButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. [Font] of the [ToolButton]'s text. From 453babc60d9364e5d7be63175eadb1dae4853ec0 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 4 Feb 2020 12:25:02 -0800 Subject: [PATCH 28/32] Finish documenting BakedLightmap and TextureLayered (cherry picked from commit 5643bc71f793fdf91dd82f0656fd65d1c3976222) --- doc/classes/BakedLightmap.xml | 7 ++++++- doc/classes/TextureLayered.xml | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/classes/BakedLightmap.xml b/doc/classes/BakedLightmap.xml index a50b9607d24..bdaa35d0732 100644 --- a/doc/classes/BakedLightmap.xml +++ b/doc/classes/BakedLightmap.xml @@ -18,7 +18,7 @@ - Bakes the lightmaps within the currently edited scene. + Bakes the lightmaps within the currently edited scene. Returns a [enum BakeError] to signify if the bake was successful, or if unsuccessful, how the bake failed. @@ -81,14 +81,19 @@ More precise bake mode but can take considerably longer to bake. + Baking was successful. + Returns if no viable save path is found. This can happen where an [member image_path] is not specified or when the save location is invalid. + Currently unused. + Returns when the baker cannot save per-mesh textures to file. + Returns if user cancels baking. diff --git a/doc/classes/TextureLayered.xml b/doc/classes/TextureLayered.xml index 4e6449222ed..e8688f237dc 100644 --- a/doc/classes/TextureLayered.xml +++ b/doc/classes/TextureLayered.xml @@ -4,7 +4,7 @@ Base class for 3D texture types. - Base class for [Texture3D] and [TextureArray]. Cannot be used directly. + Base class for [Texture3D] and [TextureArray]. Cannot be used directly, but contains all the functions necessary for accessing and using [Texture3D] and [TextureArray]. Data is set on a per-layer basis. For [Texture3D]s, the layer sepcifies the depth or Z-index, they can be treated as a bunch of 2D slices. Similarly, for [TextureArray]s, the layer specifies the array layer. @@ -23,24 +23,28 @@ + Creates the [Texture3D] or [TextureArray] with specified [code]width[/code], [code]height[/code], and [code]depth[/code]. See [enum Image.Format] for [code]format[/code] options. See [enum Flags] enumerator for [code]flags[/code] options. + Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis). + Returns the current format being used by this texture. See [enum Image.Format] for details. + Returns the height of the texture. Height is typically represented by the Y-axis. @@ -49,12 +53,14 @@ + Returns an [Image] resource with the data from specified [code]layer[/code]. + Returns the width of the texture. Width is typically represented by the X-axis. @@ -71,6 +77,7 @@ + Partially sets the data for a specified [code]layer[/code] by overwriting using the data of the specified [code]image[/code]. [code]x_offset[/code] and [code]y_offset[/code] determine where the [Image] is "stamped" over the texture. The [code]image[/code] must fit within the texture. @@ -81,23 +88,30 @@ + Sets the data for the specified layer. Data takes the form of a 2-dimensional [Image] resource. + Returns a dictionary with all the data used by this texture. + Specifies which [enum Flags] apply to this texture. + Texture will generate mipmaps on creation. + Texture will repeat when UV used is outside the 0-1 range. + Use filtering when reading from texture. Filtering smooths out pixels. Turning filtering off is slightly faster and more appropriate when you need access to individual pixels. + Equivalent to [constant FLAG_FILTER]. From 012f8ffb36df9ccabf2b5bcba02e603cbed3cdd2 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 5 Feb 2020 13:16:54 +0800 Subject: [PATCH 29/32] Shortens minimum height of script editor windows (cherry picked from commit 6785e199bb84bfefc7bd05bec2b4051733eb2ad7) --- editor/plugins/script_editor_plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index f13abd47a96..1da47196f80 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -3209,7 +3209,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_list = memnew(ItemList); scripts_vbox->add_child(script_list); - script_list->set_custom_minimum_size(Size2(150, 90) * EDSCALE); //need to give a bit of limit to avoid it from disappearing + script_list->set_custom_minimum_size(Size2(150, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing script_list->set_v_size_flags(SIZE_EXPAND_FILL); script_split->set_split_offset(140); _sort_list_on_update = true; @@ -3254,14 +3254,14 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { overview_vbox->add_child(members_overview); members_overview->set_allow_reselect(true); - members_overview->set_custom_minimum_size(Size2(0, 90) * EDSCALE); //need to give a bit of limit to avoid it from disappearing + members_overview->set_custom_minimum_size(Size2(0, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing members_overview->set_v_size_flags(SIZE_EXPAND_FILL); members_overview->set_allow_rmb_select(true); help_overview = memnew(ItemList); overview_vbox->add_child(help_overview); help_overview->set_allow_reselect(true); - help_overview->set_custom_minimum_size(Size2(0, 90) * EDSCALE); //need to give a bit of limit to avoid it from disappearing + help_overview->set_custom_minimum_size(Size2(0, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing help_overview->set_v_size_flags(SIZE_EXPAND_FILL); tab_container = memnew(TabContainer); From bc6143930645e2bcf75c079b74743c926a28b152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 5 Feb 2020 15:10:58 +0100 Subject: [PATCH 30/32] Changelog: Mention 3.2 changes to TileMap features Cf. #28896, #29519, #30231. (cherry picked from commit 989b48badcc3819a0efd05f45875c56b05cd765c) --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2224c8a7ec..15a73f7021e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -250,6 +250,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Drag-and-drop support in the TileSet editor. - Ability to attach scripts to nodes by dragging a name from the script list to a node in the scene tree. - Icons are now displayed next to code completion items, making their type easier to distinguish. +- TileMap property `centered_textures` can be used to center textures on their tile, instead of using the tile's top-left corner as position for the texture. - "Ignore" flag to ignore specific tiles when autotiling in the TileMap editor. - Keyboard shortcuts to rotate tiles in the TileMap editor. - Default shortcuts are A (rotate left), S (rotate right), X (flip horizontally), Y (flip vertically). @@ -519,6 +520,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Graph lines are now thinner and opaque. - Graph line widths are now resized to match the editor scale. - Rounded values now display trailing zeroes to make their precision clearer. +- TileMap support for transform operations on cell textures bigger than the cell size has been reworked to properly support isometric tiles. + - Breaks compatibility with some TileMaps from previous Godot versions. An opt-in `compatibility_mode` property can be used to restore the previous behavior. - Some TileMap editor options were moved to the toolbar. - The TileMap editor now displays coordinate information in the 2D viewport's bottom-left corner. - This fixes the TileMap editor width changing when hovering tiles in a small window. From 9a8455f5a7d3d76a6a1ba42b9bd0790a141f25a8 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 5 Feb 2020 22:21:47 +0100 Subject: [PATCH 31/32] Remove per-file progress reporting when exporting to Android Calling `step()` on EditorProgress too often will slow down the rest of the editor, so it's best avoided. This is also more consistent with other exporters, as most of them don't report per-file progress either. Exporting a 2D project with ~1,100 files to Android now takes about 10 seconds from a debug editor build instead of 65 seconds. This closes #30850. (cherry picked from commit 2dd3a01d11dc4786c297e95e6c716f1fb8b7cff4) --- platform/android/export/export.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index b9968c08aa4..5c44a16c8f6 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -642,9 +642,6 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { String dst_path = p_path.replace_first("res://", "assets/"); store_in_apk(ed, dst_path, p_data, _should_compress_asset(p_path, p_data) ? Z_DEFLATED : 0); - if (ed->ep->step("File: " + p_path, 3 + p_file * 100 / p_total)) { - return ERR_SKIP; - } return OK; } @@ -1497,7 +1494,7 @@ public: String adb = EditorSettings::get_singleton()->get("export/android/adb"); // Export_temp APK. - if (ep.step("Exporting APK", 0)) { + if (ep.step("Exporting APK...", 0)) { device_lock->unlock(); return ERR_SKIP; } @@ -1547,7 +1544,7 @@ public: } print_line("Installing to device (please wait...): " + devices[p_device].name); - if (ep.step("Installing to device (please wait...)", 2)) { + if (ep.step("Installing to device, please wait...", 2)) { CLEANUP_AND_RETURN(ERR_SKIP); } @@ -1614,7 +1611,7 @@ public: } } - if (ep.step("Running on Device...", 3)) { + if (ep.step("Running on device...", 3)) { CLEANUP_AND_RETURN(ERR_SKIP); } args.clear(); @@ -2119,7 +2116,7 @@ public: FileAccess *src_f = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); - if (ep.step("Creating APK", 0)) { + if (ep.step("Creating APK...", 0)) { return ERR_SKIP; } @@ -2281,7 +2278,7 @@ public: ret = unzGoToNextFile(pkg); } - if (ep.step("Adding Files...", 1)) { + if (ep.step("Adding files...", 1)) { CLEANUP_AND_RETURN(ERR_SKIP); } Error err = OK; From 341740c0bfbca3e94013c80b80b6b06e1eb8d84c Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 6 Feb 2020 10:56:43 +0800 Subject: [PATCH 32/32] Centers icon vertically in project list (cherry picked from commit c1011178c03354dd01972f4540bc07281591ff39) --- editor/project_manager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 30e31cb530f..1d2e57aefad 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1316,6 +1316,7 @@ void ProjectList::create_project_item_control(int p_index) { // The project icon may not be loaded by the time the control is displayed, // so use a loading placeholder. tf->set_texture(get_icon("ProjectIconLoading", "EditorIcons")); + tf->set_v_size_flags(SIZE_SHRINK_CENTER); if (item.missing) { tf->set_modulate(Color(1, 1, 1, 0.5)); }