Expose Viewport.gui_cancel_drag() to GDScript as a counterpart to Control.force_drag()

This commit is contained in:
graydoubt 2024-09-05 12:26:03 -04:00
parent 88ed6af1e6
commit e589c5baf3
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);