Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Fix reparenting #20

Merged
merged 1 commit into from
Feb 4, 2019
Merged

Fix reparenting #20

merged 1 commit into from
Feb 4, 2019

Conversation

eanders-ms
Copy link
Contributor

Steven noticed that reparenting wasn't working. This fixes that. FYI I coded it to preserve the child's local transform when reparenting.

@eanders-ms eanders-ms added the bug Something isn't working label Feb 2, 2019
@eanders-ms eanders-ms self-assigned this Feb 2, 2019
Copy link
Contributor

@sorenhan sorenhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@@ -155,7 +155,8 @@ internal void SynchronizeApp()

internal void ApplyPatch(ActorPatch actorPatch)
{
var parent = ParentId != null ? App.FindActor(ParentId.Value) : Parent;
var parentId = actorPatch.ParentId ?? ParentId;
var parent = parentId != null ? App.FindActor(parentId.Value) : Parent;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we patching parent in a separate function than the rest of the properties? Is this a holdover from the previous architecture?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks like a holdover. Could easily be simplified now.

@eanders-ms eanders-ms merged commit 7e0b9b9 into red Feb 4, 2019
@eanders-ms eanders-ms deleted the eanders/reparent branch February 4, 2019 18:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants