The Simulation.removeObject currently has buggy behavior where object markers, labels, and drop lines to ecliptic aren't removed when the object is. This fixes that behavior.
What is the current behavior?
See above...
How was the solution implemented (if it's not obvious)?
Added a hideParticle method on the KeplerianParticle object so that a deleting object can hide the corresponding particle marker that it used for drawing it
Implemented a removalCleanup to the SpaceObject which knows to remove the text label from the DOM and to hide the particle marker if it used it
Added a call to removalCleanup method in the Simualation.removeObject method if the corresponding object supports that method (after a check).
Ideally I think particle markers should probably be deleted not hidden since this could create a leak of sorts if objects are constantly added/removed during a run but for an initial fix this is a more streamlined update.
What does the pull request do?
The
Simulation.removeObject
currently has buggy behavior where object markers, labels, and drop lines to ecliptic aren't removed when the object is. This fixes that behavior.What is the current behavior?
See above...
How was the solution implemented (if it's not obvious)?
hideParticle
method on theKeplerianParticle
object so that a deleting object can hide the corresponding particle marker that it used for drawing itremovalCleanup
to theSpaceObject
which knows to remove the text label from the DOM and to hide the particle marker if it used itremovalCleanup
method in theSimualation.removeObject
method if the corresponding object supports that method (after a check).Ideally I think particle markers should probably be deleted not hidden since this could create a leak of sorts if objects are constantly added/removed during a run but for an initial fix this is a more streamlined update.