Skip to content

Commit

Permalink
REVIEW notes, see phetsims/my-solar-system#88
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Mar 9, 2023
1 parent 3996aa1 commit bed9e72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/view/CueingArrowsNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ export default class CueingArrowsNode extends Path {
super( createArrowsShape( options.bodyRadius, options.length ), options );

this.length = options.length;

//REVIEW: Why is this being set? Shouldn't the rotation option (that is currently passed to the super) be sufficient?
//REVIEW: I believe this can be removed
this.rotation = options.rotation;

const updateTouchArea = () => {
this.touchArea = this.localBounds.dilated( 5 );
this.mouseArea = this.localBounds.dilated( 3 );
};
//REVIEW: This depends on the localBounds, so it should link to the localBoundsProperty instead
//REVIEW: THEN, in the link, you can use localBounds as a parameter instead of having to grab `this.localBounds`
this.boundsProperty.link( updateTouchArea );

//REVIEW: Don't need/want a disposal of the updateTouchArea, since they have the same lifetime
Expand Down
7 changes: 7 additions & 0 deletions js/view/SolarSystemCommonTextNumberDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ import SolarSystemCommonStrings from '../../../solar-system-common/js/SolarSyste
import StringUtils from '../../../phetcommon/js/util/StringUtils.js';
import solarSystemCommon from '../solarSystemCommon.js';

//REVIEW: Single usage, prefer inlining (then don't have to define the type, AND won't need the extra empty {} object
//REVIEW: allocation that is in the optionize3 call below). Can just use optionize
const STRING_PATTERN_OPTIONS: NumberDisplayOptions = {
backgroundFill: null,
backgroundStroke: null,
textOptions: SolarSystemCommonConstants.TEXT_OPTIONS,
decimalPlaces: 1,
useRichText: true,

//REVIEW: layoutOptions like this should be provided at the client usage. It's not great to hardcode client uses
//REVIEW: in the type itself. Let's move this to the client!
layoutOptions: {
align: 'left'
}
};

export default class SolarSystemCommonTextNumberDisplay extends NumberDisplay {
//REVIEW: Ummm... I don't see this constructor ever getting used. Can we remove it, and not extend NumberDisplay?
//REVIEW: Perhaps we can just move combinePowerString to somewhere else common, and remove this file?
public constructor( numberProperty: TReadOnlyProperty<number | null>, displayRange: Range, providedOptions?: NumberDisplayOptions ) {
super(
numberProperty,
Expand Down

0 comments on commit bed9e72

Please sign in to comment.