phetsims / pendulum-lab

"Pendulum Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 10 forks source link

Extra intermediary Nodes in SystemSlidersNode #71

Closed aaronsamuel137 closed 9 years ago

aaronsamuel137 commented 9 years ago

During code review #56 I noticed this code in SystemSlidersNode:

    var content = new VBox( { spacing: SPACING_CONTENT, align: 'center' } );

    // add gravity slider with title and body list menu
    this.gravitySlider = new GravitySliderWithListNode( pendulumLabModel.gravityProperty,
      pendulumLabModel.gravityRange, pendulumLabModel.bodyProperty, pendulumLabModel.bodies, bodiesListNode, { y: SPACING_CONTENT } );
    content.addChild( new Node( {
      children: [
        new Text( gravityString, { font: FONT_TITLE } ),
        this.gravitySlider
      ]
    } ) );

...

      content.addChild( new Node( {
        children: [
          frictionSliderLabel,
          frictionSliderNode
        ]
      } ) );

Are these intermediary Nodes necessary, or could they be removed and have everything be in the VBox?

andrey-zelenkov commented 9 years ago

It's necessary to correct align content inside content node (vBox). If we remove this nodes than headers will be placed incorrectly.

aaronsamuel137 commented 9 years ago

Sounds good, closing.