-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Add a dedicated editor for Camera2D limits #104190
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
Conversation
69a47a4
to
266d12b
Compare
Limit rect will reduce itself after moving it for a while. godot.windows.editor.x86_64_Kox7Zfedi7.mp4 |
Fixed. |
4778d06
to
a9b9b89
Compare
Confirm that PR fixes both issues mentioned in #101427 (comment). Some suggestions:
|
It's not (easily) possible to move both limit rect and other nodes, because they are handled by 2 different editors. |
Sorry, I didn't mean to move both limit rect and other nodes at the same time. |
Well the problem is the same as mentioned. I'd need Camera2D editor to check for nodes under cursor, because it's handled by the 2D editor and other editors don't have access to that information. Although selecting might interfere with dragging if you click something by accident. And another thing are nodes selectable as rectangle instead of point; they can cover a bigger portion of camera's limit rect, making accidental selection even easier. I could accept motion events to (possibly) fix the issue with hover labels, but not sure if it's a good idea. |
What is the status of this PR? I still got crash when reloading a scene with Camera2D in master branch, and also this issue #105077. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the limit rect is enabled, it defaults to a high value for each so you cannot see the limits. There is no background color for it either, so it is not visibile in the 2d editor until the limits are changed. This is fine and you may not want to set all 4 to be in visible range. The issue is clicking inside of the limit rect it only moves it and other nodes cannot be selected, which by default will be everything in your scene.
So, I think the limits should only be movable from the edges, its fine to only allow moving the limits individually IMO. Diagonal dragging would help too. This way we can just return false in gui_input and allow other nodes to be selected.
Changing the limits in the inspector when typing or using the up down arrows doesn't update the limits in the 2d editor until it is redrawn.
Edit: Also this fixes #107409
Fixed limits not redrawing from the inspector. I commented out center dragging, I plan to revisit it later. I think it would be fine to allow it if any limit edge is visible in the viewport. That would require more changes, so I'll improve it in a follow-up. Same with corner dragging. |
Thanks! |
Thanks for hard working :D |
This improves #101427 by replacing default rect edit with a dedicated editor (and also fixes multiple Camera2DEditor bugs). The main benefit is that camera is no longer selected when clicking within it's limit rectangle.
In a separate commit I added functionality for overriding 2D editor's cursor, which makes the editor much more friendly.
SMIOycIWKf.mp4
We could apply it to other existing editors, e.g. CollisionShape2D editor.
Closes #105077
Fixes #107409