phetsims / plinko-probability

"Plinko Probability" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 7 forks source link

[Edge] Overflowed balls are hidden #86

Closed phet-steele closed 8 years ago

phet-steele commented 8 years ago

Maybe this is the first time Edge does something better? With regards to the occasional "overflow" of the cylinders (see #68), generally I've seen those overflowed balls remain visible when switching the histogram to count mode:

Chrome: overflowballs

However! Edge hides those balls:

Before: edgeoverbefore

After: edgeoverafter

Pretty neat, yea? @pixelzoom is Edge at fault here? Does it maybe reveal a way we can improve how the sim handles overflowing balls (Edge looks much cleaner)?

Seen on Edge 38.14393.0.0, for phetsims/tasks#696. Name: ‪Plinko Probability‬ URL: http://www.colorado.edu/physics/phet/dev/html/plinko-probability/1.0.0-dev.16/plinko-probability_en.html Version: 1.0.0-dev.16 2016-09-13 20:39:43 UTC Features missing: touch Flags: pointerEnabled, pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393 Language: en-US Window: 1536x747 Pixel Ratio: 2.5/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 Vendor: Microsoft (Microsoft Edge) Vertex: attribs: 16 varying: 15 uniform: 512 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"7d27130a","branch":"master"},"axon":{"sha":"e0192608","branch":"master"},"babel":{"sha":"ca508dea","branch":"master"},"brand":{"sha":"f0b1f7da","branch":"master"},"chipper":{"sha":"9f0bb7ca","branch":"master"},"dot":{"sha":"39436598","branch":"master"},"joist":{"sha":"752d3a03","branch":"master"},"kite":{"sha":"73302899","branch":"master"},"phet-core":{"sha":"c48bf320","branch":"master"},"phetcommon":{"sha":"83ea84c8","branch":"master"},"plinko-probability":{"sha":"cbd8dd29","branch":"master"},"query-string-machine":{"sha":"20686a62","branch":"master"},"scenery":{"sha":"e78ee413","branch":"master"},"scenery-phet":{"sha":"f0fc9ae8","branch":"master"},"sherpa":{"sha":"bcc28cd6","branch":"master"},"sun":{"sha":"459de68b","branch":"master"},"tandem":{"sha":"4a8edbc9","branch":"master"},"vibe":{"sha":"b422db9c","branch":"master"}}

pixelzoom commented 8 years ago

Hmmm... When switching to the histogram mode, the entire node that draws the balls should be made invisible. So any "overflow" balls should not be visible. I'll investigate, but might need @phet-steele's assistance since I don't have an Edge test machine.

pixelzoom commented 8 years ago

Oh wait... The overflow balls remain visible on Chrome, not Edge, so I should be able to reproduce and debug this myself.

pixelzoom commented 8 years ago

I said:

When switching to the histogram mode, the entire node that draws the balls should be made invisible.

This is not the case. If we did this, then we wouldn't see any balls falling through the Galton board.

pixelzoom commented 8 years ago

BallsNode.paintCanvas was already set up to not draw balls that were in bins when histogram mode was anything other than 'balls'. The problem was that BallsNode.invalidatePaint was not being called when histogramModeProperty changed, so the balls remained the screen. I fixed that (2 lines of code), and it seems to be working fine.

To facilitate testing of this, I added the maxBallsIntro query parameter., which sets the maximum number of balls on the Intro screen. Set this to something like maxBallsIntro=200 and you'll be certain to overflow one or more of the bins. Then switch the histogram mode to verify the desired behavior. (In case you were using the previous maxBalls query parameter, it has been renamed maxBallsLab, since it pertains to the Lab screen).

@phet-steele Please verify in this dev version: http://www.colorado.edu/physics/phet/dev/html/plinko-probability/1.0.0-dev.17/plinko-probability_en.html

phet-steele commented 8 years ago

This appears to be working beautifully, @pixelzoom!

pixelzoom commented 8 years ago

Bueno. Closing.