summaryrefslogtreecommitdiff
path: root/editor/plugins/canvas_item_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-09-20 13:22:47 +0200
committerGitHub <noreply@github.com>2017-09-20 13:22:47 +0200
commit372cdc20705dab7c2227b89d8bc4d425ffd3e8a4 (patch)
treea8811a50265edd940b00e12b9bd522e3e9b4694e /editor/plugins/canvas_item_editor_plugin.cpp
parentecd226c6a751f8a20766363fd1f2e1e0e2da8fba (diff)
parent5ad9be4c24e9d7dc5672fdc42cea896622fe5685 (diff)
Merge pull request #11153 from letheed/rename-pos
Rename pos/rot/loc/scl
Diffstat (limited to 'editor/plugins/canvas_item_editor_plugin.cpp')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp10
1 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 27dad7756e..28de1ad940 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -368,7 +368,7 @@ void CanvasItemEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
} else if (set_pivot_shortcut.is_valid() && set_pivot_shortcut->is_shortcut(p_ev) && drag == DRAG_NONE && can_move_pivot) {
if (!Input::get_singleton()->is_mouse_button_pressed(0)) {
List<Node *> &selection = editor_selection->get_selected_node_list();
- Vector2 mouse_pos = viewport->get_local_mouse_pos();
+ Vector2 mouse_pos = viewport->get_local_mouse_position();
if (selection.size() && viewport->get_rect().has_point(mouse_pos)) {
//just in case, make it work if over viewport
mouse_pos = transform.affine_inverse().xform(mouse_pos);
@@ -4188,13 +4188,13 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
pos = parent->call("get_global_position");
}
Transform2D trans = canvas->get_canvas_transform();
- Point2 target_pos = (p_point - trans.get_origin()) / trans.get_scale().x - pos;
+ 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") {
- target_pos -= texture_size / 2;
+ target_position -= texture_size / 2;
}
// there's nothing to be used as source position so snapping will work as absolute if enabled
- target_pos = canvas->snap_point(target_pos);
- editor_data->get_undo_redo().add_do_method(child, "set_position", target_pos);
+ target_position = canvas->snap_point(target_position);
+ editor_data->get_undo_redo().add_do_method(child, "set_position", target_position);
}
bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) {