Merge pull request #96614 from graydoubt/feat/cancel_drag

Expose `Viewport.gui_cancel_drag()` to GDScript as a counterpart to `Control.force_drag()`
This commit is contained in:
Rémi Verschelde 2024-09-06 22:38:37 +02:00
commit a6db33ef89
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 7 additions and 0 deletions

View File

@ -117,6 +117,12 @@
Returns the visible rectangle in global screen coordinates.
</description>
</method>
<method name="gui_cancel_drag">
<return type="void" />
<description>
Cancels the drag operation that was previously started through [method Control._get_drag_data] or forced with [method Control.force_drag].
</description>
</method>
<method name="gui_get_drag_data" qualifiers="const">
<return type="Variant" />
<description>

View File

@ -4695,6 +4695,7 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("warp_mouse", "position"), &Viewport::warp_mouse);
ClassDB::bind_method(D_METHOD("update_mouse_cursor_state"), &Viewport::update_mouse_cursor_state);
ClassDB::bind_method(D_METHOD("gui_cancel_drag"), &Viewport::gui_cancel_drag);
ClassDB::bind_method(D_METHOD("gui_get_drag_data"), &Viewport::gui_get_drag_data);
ClassDB::bind_method(D_METHOD("gui_is_dragging"), &Viewport::gui_is_dragging);
ClassDB::bind_method(D_METHOD("gui_is_drag_successful"), &Viewport::gui_is_drag_successful);