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

Subclass of NotePadNode for the Distribute screen #275

Closed jessegreenberg closed 2 weeks ago

jessegreenberg commented 3 weeks ago

The Fair Share and Balance Point screens each create a subclass of NotePad with their contents. The Distribute screen adds its content right in the ScreenView. This difference made it harder to add code in #272. Would it work to Create a DistributeNotepadNode containing the GroupSortInteraction and other UI components? Then, this can be removed:

    // The candy bars are not a child of the notepad, so we have to hide them manually when the info panel is visible
    // (overlaps the notepad).
    notepadCandyBarsHighlightNode.pdomVisibleProperty = DerivedProperty.not( model.meanInfoPanelVisibleProperty );

And the option in NotePadNode superclass can handle this for you.

For #270

marlitas commented 2 weeks ago

The FairShareNotepadNode only adds the collection area image (rounded sketchy rectangle), and radio button group to the notepad. All of the apples and plates are added in the screen view to minimize the complexity of lining up the table/notepad snacks and table/notepad plates in two different view coordinate systems.

I time blocked an hour to look at the possibility of adding all of the snacks and plates to the notepad instead of the screen view, and I do not think it's worth it to explore this any further especially since it affects three screens ( the cups in Level Out are also not added directly to the notepad).

In the hour I was able to migrate the code over to the notepad and then began to explore matching the x-values in the coordinate frame. If we do want to move forward with this I believe we would need a matrix between Property similar to what is used in Balance Point. It is not impossible to do, just quite a bit of work to refactor and test at this point.

@jessegreenberg let me know if you have any other concerns, or continue to feel strongly about this change. Otherwise I think we can close.

jessegreenberg commented 2 weeks ago

OK, thanks for looking into it. I don't feel strongly enough to take more time. Closing.