-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Reset origin of dragged scene preview #36309
Conversation
|
||
Node2D *n = Object::cast_to<Node2D>(instance); | ||
if (n) { | ||
n->set_position(Vector2()); |
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.
Does not _edit_set_position() work for both ?
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.
It doesn't work for Control when anchor-only mode is enabled.
As mentioned in #26549, I think we should not reset the origin of a dragged scene. The bug in #26549 IMO is that the Sprite's position is reset to the cursor drop position, instead of keeping its transform as in the original scene. If you drag a scene with its "content" at an offset of So it's not the preview which should be reset, it's the actual drag application which is wrong and loses the transform. |
Superseded by #39754. |
Fixes godotengine#26549. Supersedes godotengine#36309. (cherry picked from commit a403131)
Fixes godotengine#26549. Supersedes godotengine#36309. (cherry picked from commit a403131)
Closes half of #26549
Before:
Now:
I have no idea how to snap this to grid though.