You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In AtomPropertiesPanel, there's a lot of duplication in the options argument passed to the 2 HSliders.
Recommend to factor out the duplication, like this:
varsliderOptions={trackFill: RSConstants.PANEL_SLIDER_FILL_COLOR,trackStroke: RSConstants.PANEL_SLIDER_FILL_COLOR,majorTickStroke: RSConstants.PANEL_SLIDER_FILL_COLOR,majorTickLength: 15,tickLabelSpacing: 2,trackSize: newDimension2(sliderWidth,1),thumbSize: RSConstants.PANEL_SLIDER_THUMB_DIMENSION,thumbCenterLineStroke: 'white',startDrag: function(){// called when the pointer is pressedmodel.userInteraction=true;},endDrag: function(){// called when the pointer is releasedmodel.userInteraction=false;}}
Then fill in the things that are specific to each slider, like this:
Take special note of how _.extend is being used here (3 args), so that sliderOptions is not modified.
Note also that some of this duplication also occurs in AlphaParticlePropertiesPanel, but it's less of a concern. Up to you whether you want to address it there, and factor out a common set of options for all HSliders that you put in RSConstants.
The text was updated successfully, but these errors were encountered:
Related to #30 (code review).
In AtomPropertiesPanel, there's a lot of duplication in the options argument passed to the 2 HSliders.
Recommend to factor out the duplication, like this:
Then fill in the things that are specific to each slider, like this:
Similarly for
neutronCountSlider
.Take special note of how
_.extend
is being used here (3 args), so thatsliderOptions
is not modified.Note also that some of this duplication also occurs in AlphaParticlePropertiesPanel, but it's less of a concern. Up to you whether you want to address it there, and factor out a common set of options for all HSliders that you put in RSConstants.
The text was updated successfully, but these errors were encountered: