diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-25 23:29:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-25 23:29:30 +0200 |
commit | 56dafe916468f0c18e8ac77516c349e3dd8f93cb (patch) | |
tree | 176b9bb1217200cafec3613df6cf8369dcd73dd4 /scene/gui/control.cpp | |
parent | c8444c3ee078e33c33287cf879aa5daecb962a80 (diff) | |
parent | b1d15c51bc1ded928b266ffc06459dd8b2046eb4 (diff) |
Merge pull request #49744 from reduz/implement-native-extensions
Implement native extension system
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r-- | scene/gui/control.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index a8060615d4..0ae1bb04b7 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -651,19 +651,10 @@ void Control::_notification(int p_notification) { } bool Control::has_point(const Point2 &p_point) const { - if (get_script_instance()) { - Variant v = p_point; - const Variant *p = &v; - Callable::CallError ce; - Variant ret = get_script_instance()->call(SceneStringNames::get_singleton()->_has_point, &p, 1, ce); - if (ce.error == Callable::CallError::CALL_OK) { - return ret; - } + bool ret; + if (GDVIRTUAL_CALL(_has_point, p_point, ret)) { + return ret; } - /*if (has_stylebox("mask")) { - Ref<StyleBox> mask = get_stylebox("mask"); - return mask->test_mask(p_point,Rect2(Point2(),get_size())); - }*/ return Rect2(Point2(), get_size()).has_point(p_point); } @@ -2932,5 +2923,5 @@ void Control::_bind_methods() { ADD_SIGNAL(MethodInfo("minimum_size_changed")); ADD_SIGNAL(MethodInfo("theme_changed")); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "_has_point", PropertyInfo(Variant::VECTOR2, "point"))); + GDVIRTUAL_BIND(_has_point); } |