summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/import/resource_importer_texture_atlas.cpp9
-rw-r--r--editor/plugins/control_editor_plugin.cpp8
-rw-r--r--modules/visual_script/editor/visual_script_editor.cpp2
3 files changed, 14 insertions, 5 deletions
diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp
index d2a9fe2538..cd481e009e 100644
--- a/editor/import/resource_importer_texture_atlas.cpp
+++ b/editor/import/resource_importer_texture_atlas.cpp
@@ -75,6 +75,7 @@ void ResourceImporterTextureAtlas::get_import_options(const String &p_path, List
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "atlas_file", PROPERTY_HINT_SAVE_FILE, "*.png"), ""));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "import_mode", PROPERTY_HINT_ENUM, "Region,Mesh2D"), 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "crop_to_region"), false));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "trim_alpha_border_from_region"), true));
}
String ResourceImporterTextureAtlas::get_option_group_file() const {
@@ -210,14 +211,18 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file
pack_data.is_cropped = options["crop_to_region"];
int mode = options["import_mode"];
+ bool trim_alpha_border_from_region = options["trim_alpha_border_from_region"];
if (mode == IMPORT_MODE_REGION) {
pack_data.is_mesh = false;
EditorAtlasPacker::Chart chart;
- //clip a region from the image
- Rect2 used_rect = image->get_used_rect();
+ Rect2 used_rect = Rect2(Vector2(), image->get_size());
+ if (trim_alpha_border_from_region) {
+ // Clip a region from the image.
+ used_rect = image->get_used_rect();
+ }
pack_data.region = used_rect;
chart.vertices.push_back(used_rect.position);
diff --git a/editor/plugins/control_editor_plugin.cpp b/editor/plugins/control_editor_plugin.cpp
index e6f267673c..7b85fea1e9 100644
--- a/editor/plugins/control_editor_plugin.cpp
+++ b/editor/plugins/control_editor_plugin.cpp
@@ -358,8 +358,12 @@ void EditorPropertySizeFlags::setup(const Vector<String> &p_options, bool p_vert
Control *gui_base = EditorNode::get_singleton()->get_gui_base();
String wide_preset_icon = SNAME("ControlAlignHCenterWide");
+ String begin_preset_icon = SNAME("ControlAlignCenterLeft");
+ String end_preset_icon = SNAME("ControlAlignCenterRight");
if (vertical) {
wide_preset_icon = SNAME("ControlAlignVCenterWide");
+ begin_preset_icon = SNAME("ControlAlignCenterTop");
+ end_preset_icon = SNAME("ControlAlignCenterBottom");
}
flag_presets->clear();
@@ -367,12 +371,12 @@ void EditorPropertySizeFlags::setup(const Vector<String> &p_options, bool p_vert
flag_presets->add_icon_item(gui_base->get_theme_icon(wide_preset_icon, SNAME("EditorIcons")), TTR("Fill"), SIZE_FLAGS_PRESET_FILL);
}
// Shrink Begin is the same as no flags at all, as such it cannot be disabled.
- flag_presets->add_icon_item(gui_base->get_theme_icon(SNAME("ControlAlignCenterLeft"), SNAME("EditorIcons")), TTR("Shrink Begin"), SIZE_FLAGS_PRESET_SHRINK_BEGIN);
+ flag_presets->add_icon_item(gui_base->get_theme_icon(begin_preset_icon, SNAME("EditorIcons")), TTR("Shrink Begin"), SIZE_FLAGS_PRESET_SHRINK_BEGIN);
if (flags.has(SIZE_SHRINK_CENTER)) {
flag_presets->add_icon_item(gui_base->get_theme_icon(SNAME("ControlAlignCenter"), SNAME("EditorIcons")), TTR("Shrink Center"), SIZE_FLAGS_PRESET_SHRINK_CENTER);
}
if (flags.has(SIZE_SHRINK_END)) {
- flag_presets->add_icon_item(gui_base->get_theme_icon(SNAME("ControlAlignCenterRight"), SNAME("EditorIcons")), TTR("Shrink End"), SIZE_FLAGS_PRESET_SHRINK_END);
+ flag_presets->add_icon_item(gui_base->get_theme_icon(end_preset_icon, SNAME("EditorIcons")), TTR("Shrink End"), SIZE_FLAGS_PRESET_SHRINK_END);
}
flag_presets->add_separator();
flag_presets->add_item(TTR("Custom"), SIZE_FLAGS_PRESET_CUSTOM);
diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp
index e2432a1282..ff4b6a1f4b 100644
--- a/modules/visual_script/editor/visual_script_editor.cpp
+++ b/modules/visual_script/editor/visual_script_editor.cpp
@@ -3535,7 +3535,7 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri
print_error("Category not handled: " + p_category.quote());
}
- if (Object::cast_to<VisualScriptFunctionCall>(vnode.ptr()) && p_category != "Class") {
+ if (Object::cast_to<VisualScriptFunctionCall>(vnode.ptr()) && p_category != "Class" && p_category != "VisualScriptNode") {
Vector<String> property_path = p_text.split(":");
String class_of_method = property_path[0];
String method_name = property_path[1];