Two.js: [Bug] Objects created by Two.makeX can't be removed

Created on 20 Mar 2021  路  1Comment  路  Source: jonobr1/two.js

Describe the bug
Calling Two.remove on an object that has been created and added by Two.makeX does not remove the object, even when that object is later fetched by Two.scene.getById.

To Reproduce
https://jsfiddle.net/2n4j0to9/ -- Click on bottom right demo area to trigger object removal.

Expected behavior
Calling Two.remove on an object that has been created and added by Two.makeX removes the object, both when calling Two.remove on the object and when the object is fetched by Two.scene.getById.

Environment (please select one):

  • [x] Code executes in browser (e.g: using script tag to load library) -- tested with module and non-module library versions
  • [ ] Packaged software (e.g: ES6 imports, react, angular, vue.js)
  • [ ] Running headless (usually Node.js)

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 89
bug

Most helpful comment

Thank you for this! I've updated the dev branch to reflect changes / fixes to this issue. The problem is that when you change an id of a child element after it's been added to a group, the group's internal map doesn't update as well. It now does.

>All comments

Thank you for this! I've updated the dev branch to reflect changes / fixes to this issue. The problem is that when you change an id of a child element after it's been added to a group, the group's internal map doesn't update as well. It now does.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trusktr picture trusktr  路  8Comments

dev0nian picture dev0nian  路  7Comments

EdeMeijer picture EdeMeijer  路  7Comments

anderspitman picture anderspitman  路  4Comments

Muini picture Muini  路  7Comments