Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollContainer doesn't respect _clips_input override #42889

Open
rgson opened this issue Oct 18, 2020 · 0 comments
Open

ScrollContainer doesn't respect _clips_input override #42889

rgson opened this issue Oct 18, 2020 · 0 comments

Comments

@rgson
Copy link

rgson commented Oct 18, 2020

Godot version:
3.2.2.stable.official

OS/device including version:
Debian 10

Issue description:
ScrollContainer clips input by default and ignores implementations of _clips_input.

Steps to reproduce:

  1. Create a ScrollContainer
  2. Disable "Rect > Clip Content" and make it smaller than the full screen (to actually see the clipped content)
  3. Fill it with enough buttons for a scroll bar to appear
  4. Attach a script to it to disable input clipping:
extends ScrollContainer

func _clips_input():
	return false
  1. Try clicking the buttons that are outside of the ScrollContainer's bounds. They're still not clickable.

Minimal reproduction project:
scrollcontainer_clips_input.zip


It's straight-forward to see that this is caused by an override of clips_input in scroll_container.cpp that always returns true without consulting the attached script. The original implementation in control.cpp does delegate to the attached script as documented.

My suggestion would be to add the same delegation to the implementation in scroll_container.cpp.

 bool ScrollContainer::clips_input() const {
+	if (get_script_instance()) {
+		return get_script_instance()->call(SceneStringNames::get_singleton()->_clips_input);
+	}
 	return true;
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants