phetsims / fractions-intro

"Fractions Intro" is an educational simulation in HTML5, by PhET Interactive Simulations.
MIT License
1 stars 3 forks source link

Line separation of cell in containerView #76

Closed michaelm396 closed 5 years ago

michaelm396 commented 7 years ago

Currently the Fractions-proto simulation does not create line separations between the representation Nodes (i.e Circle, Vertical Rectangle, Horizontal Rectangle, Pie) in order to visually show an increase or decrease in denominatorProperty. This should be fairly simple to implement within (RepresentationNode)ContainerNode.

michaelm396 commented 7 years ago

There seems to be an issue with the edgePostion return value that specifically prohibits i = 8. This issue, in turn, crashes the entire fractions-intro browser. We tried altering the denominator Number Property in the ProtoModel to values > 8 in order to further troubleshoot. The simulation operated as expected for values of (i= 9,10,11... etc) and crashed for i =8. We attempted to fix this issue by multiplying the (CellDividersAngle*i) by a multiplier slightly larger than 1 (i.e. 1.001.), and this quick fix works for the value i = 8.

var edgePosition = Vector2.createPolar( cellDividersLength, 1.001 * i * cellDividersAngle );
        cellDividersShape.moveToPoint( edgePosition ).lineToPoint( Vector2.ZERO );

We observed, by reverting Google Chrome back to its original settings, or using another browser (i.e. Firefox) fixes the issues. This allows the sim to operate without a multiplier when i = 8.

veillette commented 7 years ago

I tested on chrome 59.0.3071 (64 bit), firefox 54.0 (64 bit) and InternetExplorer 11 without the fudge factor and I did not come across any issues with denominator=8. Hence, I reverted back the fudge factor.

Otherwise our work is done here. Assigning to @jonathanolson for review.