diff options
author | qarmin <mikrutrafal54@gmail.com> | 2019-07-01 12:59:42 +0200 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2019-07-01 12:59:42 +0200 |
commit | 3c154eb93b3a098354bf6d18a9428826ec193f90 (patch) | |
tree | d9c8c44f13883ceadaefc95953f9cb077137b7c8 /editor/plugins | |
parent | eaaff9da3178fa515a0f051fda932c1dd04d53db (diff) |
Remove unnecessary code and add some error explanations
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/path_2d_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 7 |
5 files changed, 10 insertions, 5 deletions
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h index 965e6c8827..10a1a6bd98 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/editor/plugins/collision_shape_2d_editor_plugin.h @@ -89,7 +89,7 @@ class CollisionShape2DEditorPlugin : public EditorPlugin { public: virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event) { return collision_shape_2d_editor->forward_canvas_gui_input(p_event); } - virtual void forward_canvas_draw_over_viewport(Control *p_overlay) { return collision_shape_2d_editor->forward_canvas_draw_over_viewport(p_overlay); } + virtual void forward_canvas_draw_over_viewport(Control *p_overlay) { collision_shape_2d_editor->forward_canvas_draw_over_viewport(p_overlay); } virtual String get_name() const { return "CollisionShape2D"; } bool has_main_screen() const { return false; } diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 3b1d728b8b..d2d2b8f130 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -156,9 +156,9 @@ void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) { Vector2 mpos = mm.get_position(); if (_dragging && _curve_ref.is_valid()) { - Curve &curve = **_curve_ref; if (_selected_point != -1) { + Curve &curve = **_curve_ref; if (!_has_undo_data) { // Save full curve state before dragging points, diff --git a/editor/plugins/path_2d_editor_plugin.h b/editor/plugins/path_2d_editor_plugin.h index 4edd17d146..44472f7a81 100644 --- a/editor/plugins/path_2d_editor_plugin.h +++ b/editor/plugins/path_2d_editor_plugin.h @@ -123,7 +123,7 @@ class Path2DEditorPlugin : public EditorPlugin { public: virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event) { return path2d_editor->forward_gui_input(p_event); } - virtual void forward_canvas_draw_over_viewport(Control *p_overlay) { return path2d_editor->forward_canvas_draw_over_viewport(p_overlay); } + virtual void forward_canvas_draw_over_viewport(Control *p_overlay) { path2d_editor->forward_canvas_draw_over_viewport(p_overlay); } virtual String get_name() const { return "Path2D"; } bool has_main_screen() const { return false; } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 1b00889e9a..d999f3189e 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -3463,7 +3463,7 @@ void ScriptEditorPlugin::get_window_layout(Ref<ConfigFile> p_layout) { void ScriptEditorPlugin::get_breakpoints(List<String> *p_breakpoints) { - return script_editor->get_breakpoints(p_breakpoints); + script_editor->get_breakpoints(p_breakpoints); } void ScriptEditorPlugin::edited_scene_changed() { diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 4e15bd5116..8f58fbd6ab 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -192,8 +192,8 @@ void TextureRegionEditor::_region_draw() { } updating_scroll = false; - float margins[4]; if (node_ninepatch || obj_styleBox.is_valid()) { + float margins[4]; if (node_ninepatch) { margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP); margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM); @@ -204,6 +204,11 @@ 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), |