phetsims / mean-share-and-balance

"Mean: Share and Balance" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 1 forks source link

Document or change layout for MeanShareAndBalanceControls #290

Closed jessegreenberg closed 3 months ago

jessegreenberg commented 3 months ago

Can you describe in the code how the layout works for the MeanShareAndBalanceControls? This value may be difficult to find, if the layout for the sim needs to be adjusted. Can you describe how 230 and 350 were found (is it just by inspection to align with the bottom of the notepad)? Alternatively, is there another way to set the layout for these components so that they are positioned to align relatively to other artwork in the ScreenVIew?

https://github.com/phetsims/mean-share-and-balance/blob/1b60d3cc2c016f69358245f4623a04b2bebb900a/js/common/view/MeanShareAndBalanceControls.ts#L112-L116

https://github.com/phetsims/mean-share-and-balance/blob/1b60d3cc2c016f69358245f4623a04b2bebb900a/js/common/view/MeanShareAndBalanceControls.ts#L79-L85

For #270.

marlitas commented 3 months ago

The top value for the numberSpinner is purely empirical based on the proportions of the controls and what seems to look good across all the screens. There's not one single thing that lines them up necessarily, but they must be in the same spot in all screens. I tried to add documentation to cover that, but let me know if it's not enough.

I went ahead and added the logic to calculate the vertical position of the info button instead of having it be empirical. Ready for your review @jessegreenberg!

jessegreenberg commented 3 months ago

I went ahead and added the logic to calculate the vertical position of the info button instead of having it be empirical

Nice, I think that is a great improvement. Thanks!

I edited the comment for the number spinner to indicate it is adjacent to the "real world" representation, I hope that is OK. Ready to close.