Using hidden controls can override the default tooltip behavior, but these
controls are forgotten to be deleted.
(cherry picked from commit ac19f2ca68)
Currently the mouse cursor jumps in unexpected ways, when a `ViewPanner`
is used in SubViewports or embedded Windows.
This is caused by providing wrong coordinate systems to
Input::warp_mouse_motion.
This PR replaces the use of `Input::warp_mouse_motion` with
`Viewport::wrap_mouse_in_rect` and makes sure, that the correct
coordinate systems are used.
This change makes it necessary, that all classes, that currently
use ViewPanner, need to provide the correct Viewport to ViewPanner.
Fix Rect of texture to take window and stretch transform into account.
There is no need for `viewport_attach_to_screen` for embedded windows,
since their display is handled via `Viewport::_sub_window_update`.
Previously, embedded Windows (the opened menu) were not accounted for
when checking for `switch_on_hover`.
`gui_get_hovered_control()` is more appropriate to check for the hover
status of other `MenuButton` nodes at the mouse position.
Explain the usage of the incorrectly used function in a comment.
When the mouse is hovering an embedded window, it is still considered
within the main viewport.
Previously in this case physics picking was executed, as if no embedded
window was there.
This PR introduces an additional check to exclude these cases.
The functionality of the parameter is not limited to drag-and-drop
operations, but it has also other uses.
So its name should not be tied to drag-and-drop.
The API was created in the not yet released Godot 4.4-dev6, so this
change should not be considered compatibility breaking.
`Viewport.get_stretch_transform()` returns the automatically computed
2D stretch transform. Combined with `Transform2D.get_scale()`, this is
useful when using the `canvas_items` stretch mode in a project.
There are many situations where knowing this factor is useful:
- Divide Camera2D zoom to keep the size of the 2D game world identical
regardless of the 2D scale factor (so that UI elements can still be scaled).
- Make certain controls always drawn at 1:1 scale
(e.g. for the crosshair in a FPS). This is done by dividing the Control
node's scale by the scale factor.
With the drag-and-drop rewrite, `SubViewportContainer` nodes were no
longer available as drop-locations.
This PR introduces a configuration option, that allows
`SubViewportContainer` to be considered as drop-location, but disables the
`Control` nodes inside its `SubViewport` children as drop-location.
Document exposed methods
Apply suggestions from code review
Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>
Document default behavior when no audio listeners are active