Skip to content

Commit

Permalink
Mass change workaround, see #328 and phetsims/scenery-phet#825
Browse files Browse the repository at this point in the history
(cherry picked from commit 18cc9b3)
  • Loading branch information
AgustinVallejo committed Jan 10, 2024
1 parent f186f52 commit cf1e8a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/common/model/MySolarSystemModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ export default class MySolarSystemModel extends SolarSystemCommonModel {
this.saveStartingBodyInfo();
}
} );

body.massProperty.link( mass => {
// This workaround is because NumberControl endCallback fires before changing the property, at least on single presses
// TODO: Remove this workaround when https://github.com/phetsims/scenery-phet/issues/825 is fixed
if ( !body.userIsControllingMassProperty.value ) {
this.saveStartingBodyInfo();
}
} );
} );

this.timeProperty.lazyLink( time => {
Expand Down

0 comments on commit cf1e8a9

Please sign in to comment.