phetsims / molecule-polarity

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

Z-ordering of atoms should be stateful #157

Closed KatieWoe closed 1 year ago

KatieWoe commented 1 year ago

Device Samsung OS Win 11 Browser Firefox Problem Description For https://github.com/phetsims/qa/issues/952. The z-ordering of the A and C atoms on the second screen are not stateful. We should be using IndexedNodeIO. Visuals layerstateful

pixelzoom commented 1 year ago

Reproduced in master and 1.3.0-dev.3.

In the above commits, I made the rendering order stateful for atoms A and C. By passing these options to the 2 AtomNode instances in TriatomicMoleculeNode.ts:

      // Make z-ordering stateful, see https://github.com/phetsims/molecule-polarity/issues/157
      phetioType: IndexedNodeIO,
      phetioState: true

This is relevant only to atoms A and C in the "Three Atoms" screen, because those atoms have a BondAngleDragListener, which changes the rendering order via a call to moveToFront.

Tested in State Wrapper and Studio. This required and API change, but no changes to migration rules.

@KatieWoe please verify in master, close if OK.

KatieWoe commented 1 year ago

Looks good on master