Fixed Line2D editor doesn't respond to input

This commit is contained in:
Marc Gilleron 2017-02-19 02:55:47 +01:00
parent 5e3fc7d069
commit 544d9cb24e
2 changed files with 9 additions and 4 deletions

View file

@ -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)) {

View file

@ -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; }