phetsims / number-line-distance

"Number Line: Distance" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 3 forks source link

Point labels overlap image with stringTest=long #46

Closed pixelzoom closed 3 years ago

pixelzoom commented 3 years ago

For code review #35.

Not sure if this is worth addressing. But with ?stringTest=long in the Elevation scene, the point labels overlap the picture of the ocean/sky.

screenshot_1071
amanda-phet commented 3 years ago

These labels should never be longer than 2 characters, so i'm not sure what the best route is to make sure this isn't an issue in the extremely unlikely scenario that someone puts in a long string here. Should we leave this as-is? Or is it better to have a max-width for the string?

pixelzoom commented 3 years ago

@amanda-phet said:

These labels should never be longer than 2 characters

One of those 2 characters is always x or y. They are translatable, and there's no way to enforce that they are a single character (because one glyph can require multiple bytes, depending on locale).

Also note that the penguin can overlap the point label, even in default English, see below. You have lots of horizontal space to work with, why not use it?

screenshot_1073 screenshot_1072
SaurabhTotey commented 3 years ago

I've reduced the maxWidth of the point names so that they no longer overlap with the elevation play area on stringTest=long, but I haven't moved the play area or number line yet. I'll leave this issue assigned to @amanda-phet for feedback on what to do.

amanda-phet commented 3 years ago

Thanks @SaurabhTotey. Using maxWidth is what I had in mind as a possible fix, but I wasn't sure what all of the options were.

As for moving the number line.. we can probably move it all over 10px, but not much more because things can get fairly crowded down here image

I can really go either way. @SaurabhTotey will you move it over 10px to see how it looks and assign back to me?

SaurabhTotey commented 3 years ago

Alright, I moved the elevation scene number line to the left. Assigning back to @amanda-phet.

amanda-phet commented 3 years ago

Thanks. That looks good to me!