-
Notifications
You must be signed in to change notification settings - Fork 6
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
navbar and home screen layout are messed up due to dependencies on magic numbers #185
Comments
I took a couple of stabs at fixing this (see commits/reverts towards the end of #126), but fixing one thing (e.g. location of the PhET menu on the home screen) would break something else (e.g., size of navbar). There should clearly be a dependency on ScreenView.DEFAULT_LAYOUT_BOUNDS. And there are clearly some dependencies and magic numbers that should not be in this implementation. Since @samreid was the original author, assigning to him. |
…ounds, set to those bounds explicitly instead of using DEFAULT_LAYOUT_BOUNDS, until phetsims/joist#185 is fixed
…ounds, set to those bounds explicitly instead of using DEFAULT_LAYOUT_BOUNDS, until phetsims/joist#185 is fixed
…those bounds explicitly instead of using DEFAULT_LAYOUT_BOUNDS, until #185 is fixed
I'm in the late stages of RPAL development, and I need to keep moving. So until this is resolved, I've set ScreenView.DEFAULT_LAYOUT_BOUNDS back to (0,0,768,504) in 06949b1. You can reproduce the problems described here by setting it to (0,0,1024,618). See ScreenView lines 24 & 25. |
How about this solution for now?
var DEFAULT_LAYOUT_BOUNDS = new Bounds2( 0, 0, 1024, 618 );
ScreenView.call( this, {renderer: 'svg', layoutBounds: new Bounds2( 0, 0, 768, 504 )} ); Please review and let me know your thoughts. |
Whatever change we apply to solve this problem (whether the one proposed or another one), we should apply the solution to joist/master and joist/ohtwo. |
@samreid's solution (above) sounds good. I'll handle this, and try to clean up the magic numbers too. |
…ies on magic numbers throughout HomeScreen and NavigationBar
I set HomeScreen's layoutBounds to (0,0,768,504), then replaced magic numbers in NavigationBar with references to the dimensions of sim.homeScreen.layoutBounds. Tested with a few different sims and everything looked OK. Assigning to @samreid for review. |
…d fix navbar scaling when resizing browser window
I skimmed @pixelzoom change sets and tested a single-screen sim and a multi-screen sim and all seems good. Closing. |
In #126, ScreenView.DEFAULT_LAYOUT_BOUNDS was changed from (0,0,768,504) to (0,0,1024,618). This exposed dependencies and assumptions elsewhere in joist about the layoutBounds. Many aspects of the home screen and navigation bar are affected, including:
• size of the navbar
• size of icons and labels
• spacing of icons and labels
• positioning of the PhET menu on the home screen
768, 504 and 40 (navbar height) appear in multiple places as magic numbers, with no association to ScreenView.DEFAULT_LAYOUT_BOUNDS. Font sizes also appear to have been selected based on these magic numbers, and will likely look smaller at the new DEFAULT_LAYOUT_BOUNDS. Here are some examples:
Sim:
NavigationBar:
The text was updated successfully, but these errors were encountered: