phetsims / twixt

Animation library for interactive HTML5 graphics
MIT License
1 stars 3 forks source link

duplicated ComboBox in demo app #21

Closed pixelzoom closed 5 years ago

pixelzoom commented 5 years ago

Duplicated in AnimationView and TransitionDemoView, and therefore had to be addressed twice for https://github.com/phetsims/twixt/commit/bc648b367a3c6f5ab39624fdd3fb8ea2c4a42df7:

new ComboBox( [
      ComboBox.createItem( new Text( 'Linear', comboTextOptions ), Easing.LINEAR ),
      ComboBox.createItem( new Text( 'Quadratic in-out', comboTextOptions ), Easing.QUADRATIC_IN_OUT ),
      ComboBox.createItem( new Text( 'Quadratic in', comboTextOptions ), Easing.QUADRATIC_IN ),
      ComboBox.createItem( new Text( 'Quadratic out', comboTextOptions ), Easing.QUADRATIC_OUT ),
      ComboBox.createItem( new Text( 'Cubic in-out', comboTextOptions ), Easing.CUBIC_IN_OUT ),
      ComboBox.createItem( new Text( 'Cubic in', comboTextOptions ), Easing.CUBIC_IN ),
      ComboBox.createItem( new Text( 'Cubic out', comboTextOptions ), Easing.CUBIC_OUT ),
      ComboBox.createItem( new Text( 'Quartic in-out', comboTextOptions ), Easing.QUARTIC_IN_OUT ),
      ComboBox.createItem( new Text( 'Quartic in', comboTextOptions ), Easing.QUARTIC_IN ),
      ComboBox.createItem( new Text( 'Quartic out', comboTextOptions ), Easing.QUARTIC_OUT ),
      ComboBox.createItem( new Text( 'Quintic in-out', comboTextOptions ), Easing.QUINTIC_IN_OUT ),
      ComboBox.createItem( new Text( 'Quintic in', comboTextOptions ), Easing.QUINTIC_IN ),
      ComboBox.createItem( new Text( 'Quintic out', comboTextOptions ), Easing.QUINTIC_OUT )
    ]

Assigning to @jonathanolson to address, since he created both copies.

jonathanolson commented 5 years ago

Can you recommend an improvement over the duplication? I'm not particularly inclined to add English strings to each Easing object.

pixelzoom commented 5 years ago

@jonathanolson see previous commit.

jonathanolson commented 5 years ago

Looks good, thanks for handling that!