summaryrefslogtreecommitdiff
path: root/modules/visual_script/visual_script_editor.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2020-12-23 18:24:00 +0100
committerGitHub <noreply@github.com>2020-12-23 18:24:00 +0100
commitc4c211c3b7608f79457f16bb42ad8839a9cdcf5a (patch)
treeb623ca5f4ac718466a13cf50659b1486cb6681c9 /modules/visual_script/visual_script_editor.cpp
parent1e08647195a690d14666443b7691d8406a7e73b7 (diff)
parent4b8b8039316493ee3fa77c6bb93f95e109fa68a6 (diff)
Merge pull request #44605 from madmiraal/rename-control-margin
Rename Control margin to offset
Diffstat (limited to 'modules/visual_script/visual_script_editor.cpp')
-rw-r--r--modules/visual_script/visual_script_editor.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 1bd88a2a19..19de5d4adc 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -672,7 +672,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
GraphNode *gnode = memnew(GraphNode);
gnode->set_title(node->get_caption());
- gnode->set_offset(pos * EDSCALE);
+ gnode->set_position_offset(pos * EDSCALE);
if (error_line == E->get()) {
gnode->set_overlay(GraphNode::OVERLAY_POSITION);
} else if (node->is_breakpoint()) {
@@ -2639,7 +2639,7 @@ void VisualScriptEditor::_center_on_node(const StringName &p_func, int p_id) {
if (gn) {
gn->set_selected(true);
- Vector2 new_scroll = gn->get_offset() - graph->get_size() * 0.5 + gn->get_size() * 0.5;
+ Vector2 new_scroll = gn->get_position_offset() - graph->get_size() * 0.5 + gn->get_size() * 0.5;
graph->set_scroll_ofs(new_scroll);
script->set_function_scroll(p_func, new_scroll / EDSCALE);
script->set_edited(true);
@@ -2852,7 +2852,7 @@ void VisualScriptEditor::_move_node(const StringName &p_func, int p_id, const Ve
Node *node = graph->get_node(itos(p_id));
if (Object::cast_to<GraphNode>(node)) {
- Object::cast_to<GraphNode>(node)->set_offset(p_to);
+ Object::cast_to<GraphNode>(node)->set_position_offset(p_to);
}
script->set_node_position(p_func, p_id, p_to / EDSCALE);
@@ -4786,7 +4786,7 @@ VisualScriptEditor::VisualScriptEditor() {
graph = memnew(GraphEdit);
add_child(graph);
graph->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- graph->set_anchors_and_margins_preset(Control::PRESET_WIDE);
+ graph->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
graph->connect("node_selected", callable_mp(this, &VisualScriptEditor::_node_selected));
graph->connect("begin_node_move", callable_mp(this, &VisualScriptEditor::_begin_node_move));
graph->connect("end_node_move", callable_mp(this, &VisualScriptEditor::_end_node_move));
@@ -4870,9 +4870,9 @@ VisualScriptEditor::VisualScriptEditor() {
add_child(select_func_text);
hint_text = memnew(Label);
- hint_text->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -100);
- hint_text->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
- hint_text->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
+ hint_text->set_anchor_and_offset(SIDE_TOP, ANCHOR_END, -100);
+ hint_text->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0);
+ hint_text->set_anchor_and_offset(SIDE_RIGHT, ANCHOR_END, 0);
hint_text->set_align(Label::ALIGN_CENTER);
hint_text->set_valign(Label::VALIGN_CENTER);
graph->add_child(hint_text);