Skip to content

Conversation

@carstenschwede
Copy link
Contributor

@carstenschwede carstenschwede commented May 11, 2021

Changing the parent of an object by moving it in the scene hierarchy in the Editor works by calling parent.remove(child) and splicing in the child manually to respect the insertion point. Calling .add() instead would push the child at the end of the children array. However, without a call to .add() there is no dispatch for the added event and only a removed event is triggered.

This PR adds a dispatch for the added event so both events are triggered.

Changing the parent of an object by moving it in the scene hierarchy in the Editor works by calling `parent.remove(child)` and splicing in the child manually to respect the insertion point. Calling `.add()` instead would push the child at the end of the children array. However, without a call to `.add()` there is no dispatch for the `added` event and only a `removed` event is triggered.

This PR adds a dispatch for the `added` event so both events are triggered.
@carstenschwede carstenschwede changed the title Editor: MoveObjectCommand dispatches 'added' event Editor: MoveObjectCommand should dispatch 'added' event May 11, 2021
@mrdoob mrdoob added this to the r129 milestone May 11, 2021
@mrdoob mrdoob merged commit 02a82dd into mrdoob:dev May 11, 2021
@mrdoob
Copy link
Owner

mrdoob commented May 11, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants