summaryrefslogtreecommitdiffstats
path: root/editor/plugins/canvas_item_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/canvas_item_editor_plugin.cpp')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index e882b3a8d7..36184a3f42 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1624,20 +1624,28 @@ bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) {
switch (drag_type) {
case DRAG_ANCHOR_TOP_LEFT:
- if (!use_single_axis || !use_y) control->set_anchor(MARGIN_LEFT, new_anchor.x, false, false);
- if (!use_single_axis || use_y) control->set_anchor(MARGIN_TOP, new_anchor.y, false, false);
+ if (!use_single_axis || !use_y)
+ control->set_anchor(MARGIN_LEFT, new_anchor.x, false, false);
+ if (!use_single_axis || use_y)
+ control->set_anchor(MARGIN_TOP, new_anchor.y, false, false);
break;
case DRAG_ANCHOR_TOP_RIGHT:
- if (!use_single_axis || !use_y) control->set_anchor(MARGIN_RIGHT, new_anchor.x, false, false);
- if (!use_single_axis || use_y) control->set_anchor(MARGIN_TOP, new_anchor.y, false, false);
+ if (!use_single_axis || !use_y)
+ control->set_anchor(MARGIN_RIGHT, new_anchor.x, false, false);
+ if (!use_single_axis || use_y)
+ control->set_anchor(MARGIN_TOP, new_anchor.y, false, false);
break;
case DRAG_ANCHOR_BOTTOM_RIGHT:
- if (!use_single_axis || !use_y) control->set_anchor(MARGIN_RIGHT, new_anchor.x, false, false);
- if (!use_single_axis || use_y) control->set_anchor(MARGIN_BOTTOM, new_anchor.y, false, false);
+ if (!use_single_axis || !use_y)
+ control->set_anchor(MARGIN_RIGHT, new_anchor.x, false, false);
+ if (!use_single_axis || use_y)
+ control->set_anchor(MARGIN_BOTTOM, new_anchor.y, false, false);
break;
case DRAG_ANCHOR_BOTTOM_LEFT:
- if (!use_single_axis || !use_y) control->set_anchor(MARGIN_LEFT, new_anchor.x, false, false);
- if (!use_single_axis || use_y) control->set_anchor(MARGIN_BOTTOM, new_anchor.y, false, false);
+ if (!use_single_axis || !use_y)
+ control->set_anchor(MARGIN_LEFT, new_anchor.x, false, false);
+ if (!use_single_axis || use_y)
+ control->set_anchor(MARGIN_BOTTOM, new_anchor.y, false, false);
break;
case DRAG_ANCHOR_ALL:
if (!use_single_axis || !use_y) {
@@ -5037,7 +5045,8 @@ void CanvasItemEditor::_focus_selection(int p_op) {
Map<Node *, Object *> &selection = editor_selection->get_selection();
for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->key());
- if (!canvas_item) continue;
+ if (!canvas_item)
+ continue;
if (canvas_item->get_viewport() != EditorNode::get_singleton()->get_scene_root())
continue;
@@ -5065,7 +5074,8 @@ void CanvasItemEditor::_focus_selection(int p_op) {
rect = rect.merge(canvas_item_rect);
}
};
- if (count == 0) return;
+ if (count == 0)
+ return;
if (p_op == VIEW_CENTER_TO_SELECTION) {