diff options
author | Marc Gilleron <marc.gilleron@gmail.com> | 2017-02-19 02:55:47 +0100 |
---|---|---|
committer | Marc Gilleron <marc.gilleron@gmail.com> | 2017-02-19 02:55:47 +0100 |
commit | 544d9cb24ee84730e2ca0e0e4bb704965b7a7595 (patch) | |
tree | 25d44cabea9592f8d179c7b996c8222353806b91 /tools/editor | |
parent | 5e3fc7d06956dcda8b50cd4f028c83cf967f7223 (diff) |
Fixed Line2D editor doesn't respond to input
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/plugins/line_2d_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | tools/editor/plugins/line_2d_editor_plugin.h | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/tools/editor/plugins/line_2d_editor_plugin.cpp b/tools/editor/plugins/line_2d_editor_plugin.cpp index 5ecbcaac45..c90d1c4754 100644 --- a/tools/editor/plugins/line_2d_editor_plugin.cpp +++ b/tools/editor/plugins/line_2d_editor_plugin.cpp @@ -50,7 +50,7 @@ int Line2DEditor::get_point_index_at(Vector2 gpos) { return -1; } -bool Line2DEditor::forward_input_event(const InputEvent& p_event) { +bool Line2DEditor::forward_gui_input(const InputEvent& p_event) { if (!node) return false; @@ -84,8 +84,8 @@ bool Line2DEditor::forward_input_event(const InputEvent& p_event) { undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(), "update"); undo_redo->commit_action(); } + return true; } - return true; } if(mb.pressed && mb.button_index == BUTTON_LEFT && ((mb.mod.command && mode == MODE_EDIT) || mode == MODE_CREATE)) { diff --git a/tools/editor/plugins/line_2d_editor_plugin.h b/tools/editor/plugins/line_2d_editor_plugin.h index 0df64208a8..231f4c6ca7 100644 --- a/tools/editor/plugins/line_2d_editor_plugin.h +++ b/tools/editor/plugins/line_2d_editor_plugin.h @@ -15,7 +15,7 @@ class Line2DEditor : public HBoxContainer { GDCLASS(Line2DEditor, HBoxContainer) public: - bool forward_input_event(const InputEvent& p_event); + bool forward_gui_input(const InputEvent& p_event); void edit(Node *p_line2d); Line2DEditor(EditorNode *p_editor); @@ -65,7 +65,12 @@ class Line2DEditorPlugin : public EditorPlugin { GDCLASS( Line2DEditorPlugin, EditorPlugin ) public: - virtual bool forward_canvas_input_event(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return line2d_editor->forward_input_event(p_event); } + virtual bool forward_canvas_gui_input( + const Transform2D& p_canvas_xform, + const InputEvent& p_event) + { + return line2d_editor->forward_gui_input(p_event); + } virtual String get_name() const { return "Line2D"; } bool has_main_screen() const { return false; } |