diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-01 11:42:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 11:42:41 +0200 |
commit | 769691ab53f46763582a46df8c4583f9ba1a944f (patch) | |
tree | 3f86a8c9a3f4352be2a916170a9110cb12a66123 /scene | |
parent | 6ed3e9c182627385bf7e249bf770e845d0b949d8 (diff) | |
parent | ad30b0a8dd793efa2ca60b424f3dc1e25975de68 (diff) |
Merge pull request #51273 from EricEzaM/multiple-events-per-shortcut-take2
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/control.cpp | 11 | ||||
-rw-r--r-- | scene/gui/control.h | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 81411d5844..ea82a0d131 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -742,7 +742,7 @@ bool Control::has_point(const Point2 &p_point) const { return Rect2(Point2(), get_size()).has_point(p_point); } -void Control::set_drag_forwarding(Control *p_target) { +void Control::set_drag_forwarding(Node *p_target) { if (p_target) { data.drag_owner = p_target->get_instance_id(); } else { @@ -754,8 +754,7 @@ Variant Control::get_drag_data(const Point2 &p_point) { if (data.drag_owner.is_valid()) { Object *obj = ObjectDB::get_instance(data.drag_owner); if (obj) { - Control *c = Object::cast_to<Control>(obj); - return c->call("_get_drag_data_fw", p_point, this); + return obj->call("_get_drag_data_fw", p_point, this); } } @@ -771,8 +770,7 @@ bool Control::can_drop_data(const Point2 &p_point, const Variant &p_data) const if (data.drag_owner.is_valid()) { Object *obj = ObjectDB::get_instance(data.drag_owner); if (obj) { - Control *c = Object::cast_to<Control>(obj); - return c->call("_can_drop_data_fw", p_point, p_data, this); + return obj->call("_can_drop_data_fw", p_point, p_data, this); } } @@ -787,8 +785,7 @@ void Control::drop_data(const Point2 &p_point, const Variant &p_data) { if (data.drag_owner.is_valid()) { Object *obj = ObjectDB::get_instance(data.drag_owner); if (obj) { - Control *c = Object::cast_to<Control>(obj); - c->call("_drop_data_fw", p_point, p_data, this); + obj->call("_drop_data_fw", p_point, p_data, this); return; } } diff --git a/scene/gui/control.h b/scene/gui/control.h index 9cec5d6e8d..e6ec741d99 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -355,7 +355,7 @@ public: virtual Size2 get_minimum_size() const; virtual Size2 get_combined_minimum_size() const; virtual bool has_point(const Point2 &p_point) const; - virtual void set_drag_forwarding(Control *p_target); + virtual void set_drag_forwarding(Node *p_target); virtual Variant get_drag_data(const Point2 &p_point); virtual bool can_drop_data(const Point2 &p_point, const Variant &p_data) const; virtual void drop_data(const Point2 &p_point, const Variant &p_data); |