Porting of https://github.com/phetsims/scenery/commit/f0dbdda2ed30a0fc22c240a7d0e7fca24d3e0fef, see https://github.com/phetsims/scenery/issues/374
Porting of https://github.com/phetsims/scenery/commit/f0dbdda2ed30a0fc22c240a7d0e7fca24d3e0fef, see https://github.com/phetsims/scenery/issues/374

phetsims/scenery,phetsims/scenery,phetsims/scenery