Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document or change layout for MeanShareAndBalanceControls #290

Closed
jessegreenberg opened this issue Jun 14, 2024 · 2 comments
Closed

Document or change layout for MeanShareAndBalanceControls #290

jessegreenberg opened this issue Jun 14, 2024 · 2 comments

Comments

@jessegreenberg
Copy link
Contributor

jessegreenberg commented Jun 14, 2024

Can you describe in the code how the layout works for the MeanShareAndBalanceControls? This value may be difficult to find, if the layout for the sim needs to be adjusted. Can you describe how 230 and 350 were found (is it just by inspection to align with the bottom of the notepad)? Alternatively, is there another way to set the layout for these components so that they are positioned to align relatively to other artwork in the ScreenVIew?

this.numberSpinner = controlsAlignGroup.createBox( numberSpinner, {
top: 350,
xAlign: 'left'
} );

this.infoButton = new InfoButton( {
listener: () => {
options.infoPanelVisibleProperty!.value = !options.infoPanelVisibleProperty!.value;
options.onInfoButtonPressed();
},
centerY: 230,
scale: 0.6,

For #270.

@marlitas
Copy link
Contributor

The top value for the numberSpinner is purely empirical based on the proportions of the controls and what seems to look good across all the screens. There's not one single thing that lines them up necessarily, but they must be in the same spot in all screens. I tried to add documentation to cover that, but let me know if it's not enough.

I went ahead and added the logic to calculate the vertical position of the info button instead of having it be empirical. Ready for your review @jessegreenberg!

@jessegreenberg
Copy link
Contributor Author

I went ahead and added the logic to calculate the vertical position of the info button instead of having it be empirical

Nice, I think that is a great improvement. Thanks!

I edited the comment for the number spinner to indicate it is adjacent to the "real world" representation, I hope that is OK. Ready to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants