Closed pixelzoom closed 6 months ago
@samreid I believe you will be doing some balancing act instrumentation, if this issue can be dealt with as part of that effort, it seems appropriate considering @pixelzoom comment above regarding iO implications.
This did not fall under the scope of the the current PhET-iO instrumentation goals, self-unassigning for now.
I have updated the sim to use the common code version of ruler node. The motivation for the copied RulerNode
was that some browsers (I'm looking at you, Firefox) were not supporting rotation of text very well when this sim was first developed. The text would tend to jump around on the ruler in a potentially distracting way as it rotated back and forth. Rasterizing the text (i.e. turning it into an image) solved the problem. Several years have now passed, and it seems like the browsers have better support for rotating text, so perhaps we can get rid of the copied version of RulerNode
that had the rasterized text.
I've tested these changes on my Dell Win10 machine using Chrome, Firefox, and Edge, and on an iPad 4. In all cases, the text on the ruler looked fine, and I didn't notice any of the jumpiness and weird looking artifacts that were there years ago.
I'd like QA to test this on master using all of our supported platforms. If the text on the ruler looks okay as it moves, this can be closed. Note that we're not looking for an exact match with the currently published version, we're just verifying that the text looks decent.
I believe this was addressed in https://github.com/phetsims/qa/issues/686 and determined not to be fixed. Removing the ready for qa label. @jbphet if I am mistaken and this is different let me know.
I removed the copy of the ruler node that rasterized the text, and then had QA test it. They said that there is now some noticeable strobing of the rotating text on some platforms, see https://github.com/phetsims/qa/issues/686. It appears that the browsers that had the problem rendering rotated text before still have it, though perhaps to a lesser degree.
I'm reluctant to revert back to the copy of the ruler node because it's adding back some code duplication. I'm going to leave the code as it is, where it uses the common-code RulerNode
without rasterized text, and the next time this sim is published from master we should test again and make a call whether the ruler and its rotating text are good enough without the rasterization. If we do decide to take the time to improve this, we should consider an option to RulerNode
instead of having the copied and modified version that we previously had here.
I will include this as an issue for QA to check on when we go into dev testing.
With mac + chrome I see the tiniest bit of sputtering. I'm not sure I would notice this if I wasn't looking for it.
https://github.com/phetsims/balancing-act/assets/87318828/5f45df38-bf68-4b90-addf-b1b3671f8b71
I also wonder if https://github.com/phetsims/balancing-act/issues/156 is somehow related.
I'm also still seeing the text sputtering in Win 11 + Chrome. Not sure if it's more pronounced or just more noticeable when zoomed in. Also, the text shifts vertically when panning at higher zoom levels.
https://github.com/phetsims/balancing-act/assets/52978048/1f975e1d-8978-4862-83b0-51317135179a
@KatieWoe had a good point, though I don't think it's related to #156. Even after fixing it, the text problem remains. As well, the text 'bounces' a bit in place when zooming in.
https://github.com/phetsims/balancing-act/assets/52978048/331e70ac-0319-4a46-b01b-786a2271782f
@jbphet's earlier proposed solution involves rasterizing the text on the RulerNode
by adding an option for it. As @Nancy-Salpepi said though, the text issue seems minor unless actively searched for. So, I'm leaning towards keeping the text as is without rasterization. @jbphet, could you weigh in here? Thanks!
I just watched the video above and tested the behavior on both Firefox and Chrome on my Win 11 machine. I think the "sputtering" problem is now minor enough that we don't need to worry about rasterizing the text.
With that, I think this issue can be closed and the republication of this sim from main can move forward.
While reviewing #79, I came across this TODO in
RulerNodeRasterizedText
:16 is closed, but these "workarounds" are still in place. Using a "copy" like this will be a problem for PhET-iO instrumentation and (eventually) a11y. It also doesn't fix the problem or allow other sims to benefit from the fix.
Assuming that "common code" is referring to
SCENERY_PHET/RulerNode
.... If this is really a problem, then an issue should be (and should have been) created in scenery-phet. If it's no longer an issue, then this sim should be changed to use RulerNode.Assigning to @ariel-phet to prioritize and assign.