phetsims / unit-rates

"Unit Rates" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 2 forks source link

marker editor animation doesn't pause when switching screens #154

Closed pixelzoom closed 7 years ago

pixelzoom commented 7 years ago

The marker editor is currently animated using TWEEN. When switching screens, TWEEN animations are not paused, they continue to run. (This is a joist problem, see https://github.com/phetsims/joist/issues/404.) And screens don't know when they become inactive, so they can't pause/cancel a TWEEN animation. So we're currently stuck with the marker editor continuing to animate when we switch to a different screen.

Options:

  1. Don't worry about it. In practice, the marker editor moves quickly, and doesn't require a lot of resources. If there user switches back to a screen quickly, they may still see the marker editor moving. But it's more likely that they'll see that the marker editor has moved to it's final destination, and the animation will have completed.

  2. Ditch TWEEN and handle animation in the model (model.step). This would involve making MarkerEditor extend Movable, and animation would then pause when switching screens. The downside here is that Movable has no ease-in/ease-out support, and adding that is one more task I really don't need.

I'm leaning towards (1). @arouinfar thoughts?

arouinfar commented 7 years ago

If there user switches back to a screen quickly, they may still see the marker editor moving.

I have tried several times to catch the rouge animated marker editor in dev.57, but to no avail. Let's go with option (1) @pixelzoom.

pixelzoom commented 7 years ago

Closing this issue as "won't fix".