Fixed Line2D editor doesn't respond to input
This commit is contained in:
parent
5e3fc7d069
commit
544d9cb24e
2 changed files with 9 additions and 4 deletions
|
@ -50,7 +50,7 @@ int Line2DEditor::get_point_index_at(Vector2 gpos) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Line2DEditor::forward_input_event(const InputEvent& p_event) {
|
bool Line2DEditor::forward_gui_input(const InputEvent& p_event) {
|
||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return false;
|
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->add_undo_method(canvas_item_editor->get_viewport_control(), "update");
|
||||||
undo_redo->commit_action();
|
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)) {
|
if(mb.pressed && mb.button_index == BUTTON_LEFT && ((mb.mod.command && mode == MODE_EDIT) || mode == MODE_CREATE)) {
|
||||||
|
|
|
@ -15,7 +15,7 @@ class Line2DEditor : public HBoxContainer {
|
||||||
GDCLASS(Line2DEditor, HBoxContainer)
|
GDCLASS(Line2DEditor, HBoxContainer)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool forward_input_event(const InputEvent& p_event);
|
bool forward_gui_input(const InputEvent& p_event);
|
||||||
void edit(Node *p_line2d);
|
void edit(Node *p_line2d);
|
||||||
Line2DEditor(EditorNode *p_editor);
|
Line2DEditor(EditorNode *p_editor);
|
||||||
|
|
||||||
|
@ -65,7 +65,12 @@ class Line2DEditorPlugin : public EditorPlugin {
|
||||||
GDCLASS( Line2DEditorPlugin, EditorPlugin )
|
GDCLASS( Line2DEditorPlugin, EditorPlugin )
|
||||||
|
|
||||||
public:
|
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"; }
|
virtual String get_name() const { return "Line2D"; }
|
||||||
bool has_main_screen() const { return false; }
|
bool has_main_screen() const { return false; }
|
||||||
|
|
Loading…
Reference in a new issue