phetsims / neuron

"Neuron" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 3 forks source link

The "All Ions" control doesn't work if sim is paused #100

Closed jbphet closed 8 years ago

jbphet commented 8 years ago

If the sim is paused and the "All Ions" check box is checked and unchecked, the ions don't appear or disappear. If the user pauses the sim, turns off "All Ions", then starts stepping the sim, the background ions disappear after 10 steps.

jbphet commented 8 years ago

This is true regardless of whether WebGL or canvas is being used to render the particles.

jbphet commented 8 years ago

There is also a noticeable delay during normal operation when the "All Ions" checkbox is unchecked and the background particles disappear.

jbphet commented 8 years ago

I discussed this issue with @jonathanolson, and he said that it is a bit of an issue with Scenery, because Scenery is assuming that at least one thing will be drawn in the paintWebGLDrawable call and, if nothing is, no update will occur. The scenery issue is recorded here: https://github.com/phetsims/scenery/issues/503. We run into this because there are cases where no particles are drawn when the showAllIons flag is turned off.

jbphet commented 8 years ago

The trickiest test for this is to start up the sim, immediately pause it, then turn off the showing of all ions. This is the worst case because at this point no transient particles are traveling through the leakage channels (the sim takes a little while to create the first ones).

jbphet commented 8 years ago

This is also a problem with the fallback node ParticlesCanvasNode, and can be tested using the webgl=false query parameter.

jbphet commented 8 years ago

I've addressed this issue in two major ways:

Testing indicates that these changes address the issue. Closing.