You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SubViewportContainer with rect_clip_content = true
SubViewport (blue area)
Area2D + CollisionShape2D (gray + red area)
A CollisionShape2D within a SubViewport receives Mouse-events on positions that are not visible in the viewport.
I would expect to receive MouseEnter and MouseExit events at the border of the gray area, however current behavior is that the events trigger in the following way:
Enter event at the border of the red area
Exit event at the border of the red+gray+blue area
This is related to #28833, but not a duplicate, because this issue is based on_unhandled_input, while the other is based on _gui_input.
The reason for this issue is, that _unhandled_input is propagated by SubViewportContainer to its SubViewport, even if the position of the event is outside of the SubViewportContainer.
This issue can be solved by ensuring that SubViewportContainer propagates events with a position property to its SubViewports _unhandled_input only if the event happens within the area of the SubViewportContainer. The combination of PR #57894 + #58334 fixes this problem.
Godot version
v4.0.alpha.custom_build [31b3bda]
System information
Debian 11, Vulkan
Issue description
Prerequisite:
rect_clip_content = true
Area2D
+CollisionShape2D
(gray + red area)A
CollisionShape2D
within aSubViewport
receives Mouse-events on positions that are not visible in the viewport.I would expect to receive MouseEnter and MouseExit events at the border of the gray area, however current behavior is that the events trigger in the following way:
This is related to #28833, but not a duplicate, because this issue is based on
_unhandled_input
, while the other is based on_gui_input
.The reason for this issue is, that
_unhandled_input
is propagated bySubViewportContainer
to itsSubViewport
, even if the position of the event is outside of theSubViewportContainer
.This issue can be solved by ensuring that
SubViewportContainer
propagates events with a position property to its SubViewports_unhandled_input
only if the event happens within the area of theSubViewportContainer
. The combination of PR #57894 + #58334 fixes this problem.Steps to reproduce
Minimal reproduction project
ViewportPhysicsClip.zip
The text was updated successfully, but these errors were encountered: