summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorPoommetee Ketson <poommetee@protonmail.com>2017-09-30 22:28:25 +0700
committerGitHub <noreply@github.com>2017-09-30 22:28:25 +0700
commitf058fa660d8ac05c264e4d2392c7ebd0354428f8 (patch)
treeea19df1e719b089d9802719b0ff29bbee22159ba /editor/plugins
parent9f1a5e71a68c646327a23a1d77deb0d34e335a11 (diff)
parent1f30bcb2648555ee8fd0fd66d25732cb8ca1f50d (diff)
Merge pull request #11720 from ISylvox/EnhanceExperience-onUsing-DragNDropAssetTo2DViewport
Rename Patch9Rect into NinePatchRect on "Drag & Drop Asset to 2D Viewport" Feature
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp8
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index f3006938a8..ff0069efa5 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -4181,7 +4181,7 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
editor_data->get_undo_redo().add_do_property(child, property, texture);
// make visible for certain node type
- if (default_type == "Patch9Rect") {
+ if (default_type == "NinePatchRect") {
editor_data->get_undo_redo().add_do_property(child, "rect/size", texture_size);
} else if (default_type == "Polygon2D") {
PoolVector<Vector2> list;
@@ -4199,7 +4199,7 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
}
Transform2D trans = canvas->get_canvas_transform();
Point2 target_position = (p_point - trans.get_origin()) / trans.get_scale().x - pos;
- if (default_type == "Polygon2D" || default_type == "TouchScreenButton" || default_type == "TextureRect" || default_type == "Patch9Rect") {
+ if (default_type == "Polygon2D" || default_type == "TouchScreenButton" || default_type == "TextureRect" || default_type == "NinePatchRect") {
target_position -= texture_size / 2;
}
// there's nothing to be used as source position so snapping will work as absolute if enabled
@@ -4275,7 +4275,7 @@ void CanvasItemEditorViewport::_perform_drop_data() {
child = memnew(TouchScreenButton);
else if (default_type == "TextureRect")
child = memnew(TextureRect);
- else if (default_type == "Patch9Rect")
+ else if (default_type == "NinePatchRect")
child = memnew(NinePatchRect);
else
child = memnew(Sprite); // default
@@ -4437,7 +4437,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte
types.push_back("TouchScreenButton");
// Control
types.push_back("TextureRect");
- types.push_back("Patch9Rect");
+ types.push_back("NinePatchRect");
target_node = NULL;
editor = p_node;
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 3370ce51fd..0a7f3ff8f9 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -907,7 +907,7 @@ void TextureRegionEditorPlugin::edit(Object *p_object) {
}
bool TextureRegionEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Sprite") || p_object->is_class("Patch9Rect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture");
+ return p_object->is_class("Sprite") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture");
}
void TextureRegionEditorPlugin::make_visible(bool p_visible) {