diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2020-12-23 18:24:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-23 18:24:00 +0100 |
commit | c4c211c3b7608f79457f16bb42ad8839a9cdcf5a (patch) | |
tree | b623ca5f4ac718466a13cf50659b1486cb6681c9 /modules | |
parent | 1e08647195a690d14666443b7691d8406a7e73b7 (diff) | |
parent | 4b8b8039316493ee3fa77c6bb93f95e109fa68a6 (diff) |
Merge pull request #44605 from madmiraal/rename-control-margin
Rename Control margin to offset
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/gdnative/rect2.cpp | 8 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 14 |
4 files changed, 14 insertions, 14 deletions
diff --git a/modules/gdnative/gdnative/rect2.cpp b/modules/gdnative/gdnative/rect2.cpp index 0576fb569f..9897b96c09 100644 --- a/modules/gdnative/gdnative/rect2.cpp +++ b/modules/gdnative/gdnative/rect2.cpp @@ -127,10 +127,10 @@ godot_rect2 GDAPI godot_rect2_grow_individual(const godot_rect2 *p_self, const g return dest; } -godot_rect2 GDAPI godot_rect2_grow_margin(const godot_rect2 *p_self, const godot_int p_margin, const godot_real p_by) { +godot_rect2 GDAPI godot_rect2_grow_margin(const godot_rect2 *p_self, const godot_int p_side, const godot_real p_by) { godot_rect2 dest; const Rect2 *self = (const Rect2 *)p_self; - *((Rect2 *)&dest) = self->grow_margin((Margin)p_margin, p_by); + *((Rect2 *)&dest) = self->grow_margin((Side)p_side, p_by); return dest; } @@ -270,10 +270,10 @@ godot_rect2i GDAPI godot_rect2i_grow_individual(const godot_rect2i *p_self, cons return dest; } -godot_rect2i GDAPI godot_rect2i_grow_margin(const godot_rect2i *p_self, const godot_int p_margin, const godot_int p_by) { +godot_rect2i GDAPI godot_rect2i_grow_margin(const godot_rect2i *p_self, const godot_int p_side, const godot_int p_by) { godot_rect2i dest; const Rect2i *self = (const Rect2i *)p_self; - *((Rect2i *)&dest) = self->grow_margin((Margin)p_margin, p_by); + *((Rect2i *)&dest) = self->grow_margin((Side)p_side, p_by); return dest; } diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index 52f8c837c4..5ea5c8ee8d 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -327,7 +327,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { VBoxContainer *container = memnew(VBoxContainer); add_child(container); - container->set_anchors_and_margins_preset(PRESET_WIDE); + container->set_anchors_and_offsets_preset(PRESET_WIDE); HBoxContainer *hbox = memnew(HBoxContainer); container->add_child(hbox); @@ -381,7 +381,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { new_architecture_input = memnew(LineEdit); new_architecture_dialog->add_child(new_architecture_input); // new_architecture_dialog->set_custom_minimum_size(Vector2(300, 80) * EDSCALE); - new_architecture_input->set_anchors_and_margins_preset(PRESET_HCENTER_WIDE, PRESET_MODE_MINSIZE, 5 * EDSCALE); + new_architecture_input->set_anchors_and_offsets_preset(PRESET_HCENTER_WIDE, PRESET_MODE_MINSIZE, 5 * EDSCALE); new_architecture_dialog->get_ok_button()->connect("pressed", callable_mp(this, &GDNativeLibraryEditor::_on_create_new_entry)); } diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index cda217acf0..d4fbecd60f 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1288,7 +1288,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { info_message->set_align(Label::ALIGN_CENTER); info_message->set_autowrap(true); info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - info_message->set_anchors_and_margins_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); + info_message->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); mesh_library_palette->add_child(info_message); edit_axis = Vector3::AXIS_Y; 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); |