Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Feb 17, 2020

Closes half of #26549

Before:
pkwwkT5i7E

Now:
Yg38QpIN7o

I have no idea how to snap this to grid though.


Node2D *n = Object::cast_to<Node2D>(instance);
if (n) {
n->set_position(Vector2());
Copy link
Member

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 ?

Copy link
Member Author

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.

@akien-mga
Copy link
Member

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 200, 100, it should have its origin at the drag position, and thus this "content" still at an offset of 200, 100 to the drag position.

So it's not the preview which should be reset, it's the actual drag application which is wrong and loses the transform.

@akien-mga
Copy link
Member

Superseded by #39754.

@akien-mga akien-mga closed this Jun 22, 2020
@akien-mga akien-mga added this to the 4.0 milestone Jun 22, 2020
akien-mga added a commit to akien-mga/godot that referenced this pull request Jun 29, 2020
huhund pushed a commit to huhund/godot that referenced this pull request Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants