This patch adds a viewport-configuration-option for sorting
physics-picking events by the Z-Index and the scene tree position
of the collision objects.
`Viewport.to_screen_rect` is used only in a single location to compare it
to `Rect2i()`.
When called from `SubViewport`, `to_screen_rect` is always equal to `Rect2i()`.
When called from `Window`, `to_screen_rect` is always different from `Rect2i()`.
So the comparison `to_screen_rect != Rect2i()` can be replaced by
`Object::cast_to<Window>(this)`.
This allows the removal of `Viewport.to_screen_rect` and the simplification of
`Viewport::_set_size`.
CanvasItem::get_screen_transform returns a transform from the CanvasItem
to the coordinate system, where a Popup - created as a child of the
CanvasItem - should be opened.
get_screen_transform makes some simplifications, that work well, when used
in the editor, but not in general cases.
Since Popups like Tooltips are now used more commonly in projects,
it becomes necessary to correct these simplifications.
This solution introduces Viewport::get_popup_base_transform, which makes
the necessary calculations.
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.
It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).
We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).
Also fixed "cf." Frenchism - it's meant as "refer to / see".
fixes#68197
when NOTIFICATION_WM_WINDOW_FOCUS_OUT is recieved by a viewport it will now call
_gui_cancel_tooltip() to avoid it hanging around after the mouse events stop
coming in
This patch implements the functionality to cancel Drag and Drop
by using the escape key or more general, the ui_cancel action.
Since this would be the third location, where the finalization of
Drag and Drop would have to be implemented, that functionality was
put into the private function _perform_drop.
Simplified gui.drag_data.get_type() != Variant::NIL to gui.dragging
because they are equivalent.
A SubViewport with default-size doesn't display its content, but shows
pink color, until it is resized.
This patch makes sure, that the size gets set during initialization.
When resizing a non-focused window, the previously focused
Window got resized.
This patch grabs focus for the actually resized window, before
starting with the resizing.