phetsims / forces-and-motion-basics

"Forces and Motion: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/forces-and-motion-basics
GNU General Public License v3.0
7 stars 10 forks source link

CT Negative spacing more than a cell's size causes issues with layout #293

Closed KatieWoe closed 2 years ago

KatieWoe commented 2 years ago
forces-and-motion-basics : xss-fuzz
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1653494592111/forces-and-motion-basics/forces-and-motion-basics_en.html?continuousTest=%7B%22test%22%3A%5B%22forces-and-motion-basics%22%2C%22xss-fuzz%22%5D%2C%22snapshotName%22%3A%22snapshot-1653494592111%22%2C%22timestamp%22%3A1653497104966%7D&brand=phet&ea&fuzz&stringTest=xss&memoryLimit=1000
Query: brand=phet&ea&fuzz&stringTest=xss&memoryLimit=1000
Uncaught Error: Assertion failed: Negative spacing more than a cell's size causes issues with layout
Error: Assertion failed: Negative spacing more than a cell's size causes issues with layout
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1653494592111/assert/js/assert.js:28:13)
at assert (FlowConstraint.ts:281:18)
at Array.forEach
at forEach (FlowConstraint.ts:268:17)
at Array.forEach
at forEach (FlowConstraint.ts:227:10)
at layout (LayoutConstraint.ts:173:13)
at updateLayout (FlowBox.ts:92:21)
at (VBox.ts:18:4)
at (MotionControlPanel.js:132:13)
id: Bayes Chrome
Snapshot from 5/25/2022, 10:03:12 AM
jessegreenberg commented 2 years ago

I think it is because of this negative spacing:

return new VBox( { spacing: -2, children: [ frictionTextNode, frictionSlider ], resize: false } );

That is where the assertion comes from. The height of the contents are less than one so that matches the error message.

jessegreenberg commented 2 years ago

Removing the spacing option alltogether seems to work OK. I think this was added as a slight pixel polish. Adjusting it slightly seems acceptable to me. Issue resolved, closing.