diff options
| author | Juan Linietsky | 2017-05-20 12:38:03 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-05-20 17:05:38 -0300 |
| commit | 5b3709d3096df737b8bb2344446be818b0389bfe (patch) | |
| tree | 649a0989b1494f3c4687d59e503310f4e6bbeb40 /editor/editor_profiler.cpp | |
| parent | 93f9a83062dbe74474a4a7928758c5cf5588238e (diff) | |
| download | godot-5b3709d3096df737b8bb2344446be818b0389bfe.tar.gz godot-5b3709d3096df737b8bb2344446be818b0389bfe.tar.zst godot-5b3709d3096df737b8bb2344446be818b0389bfe.zip | |
Removal of InputEvent as built-in Variant type..
this might cause bugs I haven't found yet..
Diffstat (limited to 'editor/editor_profiler.cpp')
| -rw-r--r-- | editor/editor_profiler.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 9d12ad687..d42712673 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -483,16 +483,20 @@ void EditorProfiler::_cursor_metric_changed(double) { _update_frame(); } -void EditorProfiler::_graph_tex_input(const InputEvent &p_ev) { +void EditorProfiler::_graph_tex_input(const Ref<InputEvent> &p_ev) { if (last_metric < 0) return; + Ref<InputEventMouse> me = p_ev; + Ref<InputEventMouseButton> mb = p_ev; + Ref<InputEventMouseMotion> mm = p_ev; + if ( - (p_ev.type == InputEvent::MOUSE_BUTTON && p_ev.mouse_button.button_index == BUTTON_LEFT && p_ev.mouse_button.pressed) || - (p_ev.type == InputEvent::MOUSE_MOTION)) { + (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) || + (mm.is_valid())) { - int x = p_ev.mouse_button.x; + int x = me->get_pos().x; x = x * frame_metrics.size() / graph->get_size().width; bool show_hover = x >= 0 && x < frame_metrics.size(); @@ -519,7 +523,7 @@ void EditorProfiler::_graph_tex_input(const InputEvent &p_ev) { hover_metric = -1; } - if (p_ev.type == InputEvent::MOUSE_BUTTON || p_ev.mouse_motion.button_mask & BUTTON_MASK_LEFT) { + if (mb.is_valid() || mb->get_button_mask() & BUTTON_MASK_LEFT) { //cursor_metric=x; updating_frame = true; |
