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

Clicking outside of a SubVieportContainer with activated rect_clip_content can trigger a gui event on a Container's descendant Control-Node #57653

Closed
Sauermann opened this issue Feb 5, 2022 · 1 comment

Comments

@Sauermann
Copy link
Contributor

Godot version

v4.0.alpha.custom_build [3db1d68]

System information

Debian 11, Vulkan

Issue description

I setup a Control and a Camera2D within a SubViewport within a SubViewportContainer so that the Control is located only partially within the SubViewport.
SubViewportContainer:rect_clip_content is set to true.
mouse_focus and focus_mode are set so that all nodes receive input events.

When I click outside of the SubVieportContainer, but within the location of the Control, I receive a gui event on Control.
I would expect, that in this case I do not receive a gui event.

Tracking it down in the source code, it looks like SubViewportContainer is not handled correctly at this location:

if (!c || !c->is_clipping_contents() || c->has_point(matrix.affine_inverse().xform(p_global))) {

Steps to reproduce

  1. Load MRP
  2. Click on the "ErrorClick" Label which lies outside of the SubViewportContainer
  3. Console shows that the gui event is received by the "Sub B" Label

Minimal reproduction project

SubViewportClick.zip

@Sauermann
Copy link
Contributor Author

Closing this, since it is a duplicate of #28833.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants