diff options
author | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2023-08-06 13:07:28 +0200 |
---|---|---|
committer | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2023-08-09 12:34:22 +0200 |
commit | 59c13fea5da195fe550f95b247bf2b84daf05b1a (patch) | |
tree | 9ec4db90a5be025c777a4ef17649e6d202763655 /scene/main/viewport.h | |
parent | f7bc653cbe81018fe362472a0143b7153a52f929 (diff) | |
download | redot-engine-59c13fea5da195fe550f95b247bf2b84daf05b1a.tar.gz |
Fix nodes receiving mouse events in black bars of `Window`
Previously for InputEvents there was no distinction between
Window-area and Viewport-area.
This was problematic in cases where stretching was used and the Window
contained black bars at the sides of the Viewport.
This PR separates the area of Window and Viewport regarding InputEvents.
Diffstat (limited to 'scene/main/viewport.h')
-rw-r--r-- | scene/main/viewport.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 331ce98cdd..1e107ea99c 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -468,7 +468,8 @@ private: SubWindowResize _sub_window_get_resize_margin(Window *p_subwindow, const Point2 &p_point); void _update_mouse_over(); - void _update_mouse_over(Vector2 p_pos); + virtual void _update_mouse_over(Vector2 p_pos); + virtual void _mouse_leave_viewport(); virtual bool _can_consume_input_events() const { return true; } uint64_t event_count = 0; @@ -482,8 +483,6 @@ protected: Size2i _get_size_2d_override() const; bool _is_size_allocated() const; - void _mouse_leave_viewport(); - void _notification(int p_what); void _process_picking(); static void _bind_methods(); |