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.
This commit is contained in:
Markus Sauermann
2023-08-06 13:07:28 +02:00
parent f7bc653cbe
commit 59c13fea5d
7 changed files with 146 additions and 10 deletions

View File

@ -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();