diff options
author | qarmin <mikrutrafal54@gmail.com> | 2019-07-20 08:09:57 +0200 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2019-07-20 08:09:57 +0200 |
commit | 6cbaf7662f5ee3ca1d02c0ebc85854fceee057af (patch) | |
tree | 9c6c688f72d0a6e2e79879be73e15adeb328d1b1 /editor/plugins | |
parent | 584ca0f156cec64c259382895e105cf27566a987 (diff) |
Changed some code showed in LGTM and Coverage
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/material_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/mesh_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/resource_preloader_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/texture_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 11 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 1 |
7 files changed, 5 insertions, 21 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 1f601e64fa..7341d58376 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1406,7 +1406,7 @@ bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) { for (int i = 0; i < 4; i++) { anchor_pos[i] = (transform * control->get_global_transform_with_canvas()).xform(_anchor_to_position(control, anchor_pos[i])); anchor_rects[i] = Rect2(anchor_pos[i], anchor_handle->get_size()); - anchor_rects[i].position -= anchor_handle->get_size() * Vector2(i == 0 || i == 3, i <= 1); + anchor_rects[i].position -= anchor_handle->get_size() * Vector2(float(i == 0 || i == 3), float(i <= 1)); } DragType dragger[] = { diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index ebacccb03c..e125c18ef1 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -34,9 +34,6 @@ void MaterialEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 6203035e25..442110cc84 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -48,9 +48,6 @@ void MeshEditor::_gui_input(Ref<InputEvent> p_event) { void MeshEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index b8d95efd49..620bf28415 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -39,9 +39,6 @@ void ResourcePreloaderEditor::_gui_input(Ref<InputEvent> p_event) { void ResourcePreloaderEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_ENTER_TREE) { load->set_icon(get_icon("Folder", "EditorIcons")); } diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 0aa4a7662c..6d71c56ead 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -39,9 +39,6 @@ void TextureEditor::_gui_input(Ref<InputEvent> p_event) { void TextureEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_PHYSICS_PROCESS) { - } - if (p_what == NOTIFICATION_READY) { //get_scene()->connect("node_removed",this,"_node_removed"); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 8f58fbd6ab..2d872c1a7f 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -193,7 +193,7 @@ void TextureRegionEditor::_region_draw() { updating_scroll = false; if (node_ninepatch || obj_styleBox.is_valid()) { - float margins[4]; + float margins[4] = { 0 }; if (node_ninepatch) { margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); @@ -204,12 +204,8 @@ void TextureRegionEditor::_region_draw() { margins[1] = obj_styleBox->get_margin_size(MARGIN_BOTTOM); margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT); margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT); - } else { - margins[0] = 0; - margins[1] = 0; - margins[2] = 0; - margins[3] = 0; } + Vector2 pos[4] = { mtx.basis_xform(Vector2(0, margins[0])) + Vector2(0, endpoints[0].y - draw_ofs.y * draw_zoom), -mtx.basis_xform(Vector2(0, margins[1])) + Vector2(0, endpoints[2].y - draw_ofs.y * draw_zoom), @@ -248,7 +244,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { if (mb->is_pressed()) { if (node_ninepatch || obj_styleBox.is_valid()) { edited_margin = -1; - float margins[4]; + float margins[4] = { 0 }; if (node_ninepatch) { margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); @@ -260,6 +256,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT); margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT); } + Vector2 pos[4] = { mtx.basis_xform(rect.position + Vector2(0, margins[0])) - draw_ofs * draw_zoom, mtx.basis_xform(rect.position + rect.size - Vector2(0, margins[1])) - draw_ofs * draw_zoom, diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 7ecceaed1d..aad30085d7 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1497,7 +1497,6 @@ void VisualShaderEditor::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) _update_graph(); - } else if (p_what == NOTIFICATION_PROCESS) { } } |