phetsims / rutherford-scattering

"Rutherford Scattering" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 3 forks source link

Issue with canvas and zoom feature in this sim #168

Closed jessegreenberg closed 3 years ago

jessegreenberg commented 4 years ago

When fuzzing this sim with the zoom feature the following errors are thrown

rutherford-scattering
Uncaught InvalidStateError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
Error: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
    at CanvasBlock.walkDown (http://10.0.0.179:8080/scenery/js/display/CanvasBlock.js:270:31)
    at CanvasBlock.update (http://10.0.0.179:8080/scenery/js/display/CanvasBlock.js:173:12)
    at BackboneDrawable.update (http://10.0.0.179:8080/scenery/js/display/BackboneDrawable.js:254:33)
    at DOMBlock.update (http://10.0.0.179:8080/scenery/js/display/DOMBlock.js:54:22)
    at BackboneDrawable.update (http://10.0.0.179:8080/scenery/js/display/BackboneDrawable.js:254:33)
    at Display.updateDisplay (http://10.0.0.179:8080/scenery/js/display/Display.js:505:24)
    at http://10.0.0.179:8080/joist/js/Sim.js:321:18
    at Action.execute (http://10.0.0.179:8080/axon/js/Action.js:226:18)
    at Sim.stepSimulation (http://10.0.0.179:8080/joist/js/Sim.js:969:31)
    at Sim.stepOneFrame (http://10.0.0.179:8080/joist/js/Sim.js:959:12)
rutherford-scattering
Uncaught Error: Assertion failed: This should not be run in the call tree of updateDisplay(). If you see this, it is likely that either the last updateDisplay() had a thrown error and it is trying to be run again (in which case, investigate that error), OR code was run/triggered from inside an updateDisplay() that has the potential to cause an infinite loop, e.g. CanvasNode paintCanvas() call manipulating another Node, or a bounds listener that Scenery missed.
Error: Assertion failed: This should not be run in the call tree of updateDisplay(). If you see this, it is likely that either the last updateDisplay() had a thrown error and it is trying to be run again (in which case, investigate that error), OR code was run/triggered from inside an updateDisplay() that has the potential to cause an infinite loop, e.g. CanvasNode paintCanvas() call manipulating another Node, or a bounds listener that Scenery missed.
    at window.assertions.assertFunction (http://10.0.0.179:8080/assert/js/assert.js:22:13)
    at Display.ensureNotPainting (http://10.0.0.179:8080/scenery/js/display/Display.js:1207:15)
    at BackboneDrawable.markDirtyDrawable (http://10.0.0.179:8080/scenery/js/display/BackboneDrawable.js:211:20)
    at SVGBlock.markDirty (http://10.0.0.179:8080/scenery/js/display/Drawable.js:292:29)
    at SVGBlock.markDirtyGroup (http://10.0.0.179:8080/scenery/js/display/SVGBlock.js:168:10)
    at SVGGroup.markDirty (http://10.0.0.179:8080/scenery/js/display/SVGGroup.js:127:18)
    at SVGGroup.markTransformDirty (http://10.0.0.179:8080/scenery/js/display/SVGGroup.js:145:12)
    at TinyEmitter.emit (http://10.0.0.179:8080/axon/js/TinyEmitter.js:71:18)
    at Node.onTransformChange (http://10.0.0.179:8080/scenery/js/nodes/Node.js:2471:27)
    at TinyEmitter.emit (http://10.0.0.179:8080/axon/js/TinyEmitter.js:71:18)

Something related to zooming in on the canvas with particles and other things. I haven't seen this in any other sim while fuzzing so putting in this repo for now and disabling the feature so this doesn't show up on CT.

jessegreenberg commented 3 years ago

This is a duplicate of #169