Remove viewport restrictions in 2D editor #61873
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempt to solve the long-standing issue of not being able to move nodes inside another viewport.
At first glance it works great:
Things fall apart when the viewport container is moved:
Editor gizmos appear relative to the main viewport instead of the sub-viewport.
If the viewport isn't in a container, the offset doesn't appear, but the node doesn't appear either, even though you can edit it...
And then there is Window, which has a position offset, but doesn't display anything:
So with this solution, you can edit nodes inside a sub-viewport without a problem, IF the sub viewport is inside a container, which is located at (0, 0). It works in other cases too, but the node isn't displayed correctly.
The main reason I opened this PR is #60088. Dialogs were changed from Control to Window, so their content can't be edited easily. IMO it's time to do something about the viewport issue. The PR lays some foundation, and we could think of some fix for the new problems. Mainly the offset problem. Edited nodes in sub-viewport should somehow be able to offset their gizmos based on the viewport position. Not sure if this is possible.
Resolves #20619
Fixes #60088 (content doesn't display, but technically you can edit it)
Closes godotengine/godot-proposals#2139 (I think?)