diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 159842199..aa0ef4d01 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -20,13 +20,6 @@ https://github.com/Relintai/pandemonium_demo_projects/tree/master/gui - - - - Virtual method to be implemented by the user. Returns whether [method _gui_input] should not be called for children controls outside this control's rectangle. Input will be clipped to the Rect of this [Control]. Similar to [member rect_clip_content], but doesn't affect visibility. - If not overridden, defaults to [code]false[/code]. - - @@ -52,7 +45,7 @@ * control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; * control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; * control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event; - * it happens outside the parent's rectangle and the parent has either [member rect_clip_content] or [method _clips_input] enabled. + * it happens outside the parent's rectangle and the parent has either [member rect_clip_content] or [method rect_clip_content] enabled. [b]Note:[/b] Event position is relative to the control origin. diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index b393675a6..789b7e943 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -245,10 +245,6 @@ void GraphEdit::disconnect_node(const StringName &p_from, int p_from_port, const } } -bool GraphEdit::clips_input() const { - return true; -} - void GraphEdit::get_connection_list(List *r_connections) const { *r_connections = connections; } diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index 9ba652564..06e9553f1 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -237,7 +237,6 @@ protected: virtual void add_child_notify(Node *p_child); virtual void remove_child_notify(Node *p_child); void _notification(int p_what); - virtual bool clips_input() const; public: Error connect_node(const StringName &p_from, int p_from_port, const StringName &p_to, int p_to_port); diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index b33c57285..c4e9ac65b 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -35,10 +35,6 @@ #include "scene/main/viewport.h" #include "scroll_bar.h" -bool ScrollContainer::clips_input() const { - return true; -} - Size2 ScrollContainer::get_minimum_size() const { Ref sb = get_theme_stylebox("bg"); Size2 min_size; diff --git a/scene/gui/scroll_container.h b/scene/gui/scroll_container.h index d4f8b1127..81734799d 100644 --- a/scene/gui/scroll_container.h +++ b/scene/gui/scroll_container.h @@ -103,8 +103,6 @@ public: VScrollBar *get_v_scrollbar(); void ensure_control_visible(Control *p_control); - virtual bool clips_input() const; - virtual String get_configuration_warning() const; ScrollContainer(); diff --git a/scene/main/control.cpp b/scene/main/control.cpp index 6ee9229b4..c38d7d80a 100644 --- a/scene/main/control.cpp +++ b/scene/main/control.cpp @@ -669,13 +669,6 @@ void Control::_notification(int p_notification) { } } -bool Control::clips_input() const { - if (get_script_instance()) { - return get_script_instance()->call(SceneStringNames::get_singleton()->_clips_input); - } - return false; -} - bool Control::has_point(const Point2 &p_point) const { if (get_script_instance()) { Variant v = p_point; @@ -2900,7 +2893,6 @@ void Control::_bind_methods() { BIND_VMETHOD(MethodInfo( PropertyInfo(Variant::OBJECT, "control", PROPERTY_HINT_RESOURCE_TYPE, "Control"), "_make_custom_tooltip", PropertyInfo(Variant::STRING, "for_text"))); - BIND_VMETHOD(MethodInfo(Variant::BOOL, "_clips_input")); ADD_GROUP("Anchor", "anchor_"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_left", PROPERTY_HINT_RANGE, "0,1,0.001,or_lesser,or_greater"), "_set_anchor", "get_anchor", MARGIN_LEFT); diff --git a/scene/main/control.h b/scene/main/control.h index 8744d472f..5c023da32 100644 --- a/scene/main/control.h +++ b/scene/main/control.h @@ -325,7 +325,6 @@ public: virtual Size2 get_minimum_size() const; virtual Size2 get_combined_minimum_size() const; virtual bool has_point(const Point2 &p_point) const; - virtual bool clips_input() const; virtual void set_drag_forwarding(Control *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; diff --git a/scene/main/scene_string_names.cpp b/scene/main/scene_string_names.cpp index 0595912ba..a6bcbaf81 100644 --- a/scene/main/scene_string_names.cpp +++ b/scene/main/scene_string_names.cpp @@ -115,8 +115,6 @@ SceneStringNames::SceneStringNames() { _update_scroll = StaticCString::create("_update_scroll"); _update_xform = StaticCString::create("_update_xform"); - _clips_input = StaticCString::create("_clips_input"); - _proxgroup_add = StaticCString::create("_proxgroup_add"); _proxgroup_remove = StaticCString::create("_proxgroup_remove"); diff --git a/scene/main/scene_string_names.h b/scene/main/scene_string_names.h index 83adad47c..0b53a0198 100644 --- a/scene/main/scene_string_names.h +++ b/scene/main/scene_string_names.h @@ -140,8 +140,6 @@ public: StringName _update_scroll; StringName _update_xform; - StringName _clips_input; - StringName _proxgroup_add; StringName _proxgroup_remove; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 36dd06c73..a970af95e 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1718,7 +1718,7 @@ Control *Viewport::_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_ Control *c = Object::cast_to(p_node); - if (!c || !c->clips_input() || c->has_point(matrix.affine_inverse().xform(p_global))) { + if (!c || !c->is_clipping_contents() || c->has_point(matrix.affine_inverse().xform(p_global))) { for (int i = p_node->get_child_count() - 1; i >= 0; i--) { if (p_node == gui.tooltip_popup) { continue;