Closed elektito closed 3 years ago
Out of curiosity, what do you use a Camera2D as a child of an OptionButton for?
I don't. That's the minimal case I got. The main use case, which I mentioned above was that I had a scene with an OptionButton and I had instantiated that into the main scene. Where I had a camera. The subscene was to the left of the main screen and I had a camera to switch to it. Then I noticed that the popup menu shows right at the edge of the screen.
So the camera doesn't need to be a child of the OptionButton. That was just the easiest method to reproduce the bug. I see that I had written in the description that the camera should be the child of the sub-scene. That's not necessary actually.
I can confirm that this happens. The popup seems to have minimum position of (0,0), but can go as positive as need be.
This might have to do with how Popup
is designed: "All popup methods ensure correct placement within the viewport."
This issue is even more visible in master, as Popups are now Windows. We end up with this:
Godot version: 3.3 RC9
OS/device including version: Ubuntu 20.04
Issue description: I've seen that when we have an OptionButton with a Camera2D as a child, and the position.x or position.y of the button is negative, the popup menu does not open directly underneath the button, but at an offset.
This also happens if we have a sub-scene with an option menu in it, and then add a Camera2D as the child of the instantiated scene.
Steps to reproduce:
Minimal reproduction project: test-option.zip