Polish: make momenta diagram vectors spacing visually uniform for 1D screens.
Closed this issue · 7 comments
Apart of #158, but since it will require larger changes I'm making a separate issue.
@ariel-phet requested that the spacing between the momenta diagram vectors for 1D screens be the same visually (same number of pixels apart, rather than the same grid-spacing apart). That way, regardless of the zoom-level, they are separated the same. This shouldn't impact learning goals since the vectors can be "anywhere in space."
I said:
Hmm, so this is probably possible but would require some refactoring (~30ish minutes?). Mainly because the momenta diagram is its own separate model, so it’s easy to sort of space them in terms of model units (grid units). What would have to be done is to also model the bounds/zoom in the model (rather than having it be a view specific thing), then calculate in grid units the spacing based on the zoom that would make it space the same visually.
I will be starting this now.
This worked out really well. @ariel-phet please review https://phet-dev.colorado.edu/html/collision-lab/1.1.0-dev.6/phet/collision-lab_en_phet.html
Looks perfect. Closing
I've been looking into this, and I realized that I'm not sure what the desired behavior should be for non-starting zoom levels. Presumably we wouldn't want it to be a full half-grid-square on the most-zoomed in, since then I believe the top arrow would be off of the diagram?
The y-position of the vectors on the Intro/1D screens is independent of the zoom level:
I'm not sure how it's specified in the code, but could we instead reduce the padding between the vectors by 10-20%? Essentially, I'd like to reduce the padding just enough that the total is never obscured by the zoom buttons.
Thanks @jonathanolson! It looks great in master.