phetsims / masses-and-springs

"Masses and Springs" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 5 forks source link

Duplicated code in OneSpringScreenView and TwoSpringScreenView #351

Closed samreid closed 4 years ago

samreid commented 4 years ago

While working on https://github.com/phetsims/gas-properties/issues/170, I noticed around 20 lines of duplicated code between OneSpringScreenView and TwoSpringScreenView.

image

Assigning to the responsible dev. Also note, I have some commits coming to these files shortly for https://github.com/phetsims/gas-properties/issues/170

Denz1994 commented 4 years ago

The code duplication essentially adjusts relevant view components when the visible bounds of the sim change.SpringScreenView.adjustViewComponents( ) was added to remove the code duplication in the two spring views. I'll let CT run a cycle before closing.