From 4e5310cc60dc17e5ef09e57115ca8236544679e4 Mon Sep 17 00:00:00 2001 From: qarmin Date: Wed, 26 Jun 2019 15:08:25 +0200 Subject: Some code changed with Clang-Tidy --- editor/plugins/canvas_item_editor_plugin.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'editor/plugins/canvas_item_editor_plugin.cpp') diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 3c24fd19b6..10f53182bf 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -71,8 +71,7 @@ class SnapDialog : public ConfirmationDialog { SpinBox *rotation_step; public: - SnapDialog() : - ConfirmationDialog() { + SnapDialog() { const int SPIN_BOX_GRID_RANGE = 256; const int SPIN_BOX_ROTATION_RANGE = 360; Label *label; @@ -490,8 +489,6 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no r_items.push_back(res); } } - - return; } void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_SelectResult> &r_items) { @@ -1999,11 +1996,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref &p_event) { return true; } - if (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_LEFT || k->get_scancode() == KEY_RIGHT)) { - // Accept the key event in any case - return true; - } - return false; + return (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_LEFT || k->get_scancode() == KEY_RIGHT)); // Accept the key event in any case } bool CanvasItemEditor::_gui_input_select(const Ref &p_event) { @@ -4340,7 +4333,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { continue; if (!n2d->get_parent_item()) continue; - if (n2d->has_meta("_edit_bone_") && (bool)n2d->get_meta("_edit_bone_") == true) + if (n2d->has_meta("_edit_bone_") && n2d->get_meta("_edit_bone_")) continue; undo_redo->add_do_method(n2d, "set_meta", "_edit_bone_", true); @@ -4390,7 +4383,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { continue; if (canvas_item->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - if (canvas_item->has_meta("_edit_ik_") && (bool)canvas_item->get_meta("_edit_ik_") == true) + if (canvas_item->has_meta("_edit_ik_") && canvas_item->get_meta("_edit_ik_")) continue; undo_redo->add_do_method(canvas_item, "set_meta", "_edit_ik_", true); -- cgit v1.2.3