Closed KatieWoe closed 6 years ago
@KatieWoe @samreid @jessegreenberg I swore I logged this like a year ago, but apparently not, so thanks! The associated warning shows this is due to WebGL:
[.Offscreen-For-WebGL-000001654EB152F0]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 0
In these cases in PieChargeWebGLSliceNode.paint
, numToDraw
is 1009 and this.vertices.length
is 2004, but this.vertices
is a flat array of x and y values, and WebGL moves through them 2 at a time, so I think that numToDraw must be less than this.vertices.length / 2 to work correctly.
We could limit the value in PieChargeWebGLSliceNode.paint
, or maybe there is a better way in PieChartWebGLNode?
I am also not sure if the skater should ever go below the ground, see #432. But this is happening when Skater.positionProperty.get().y is negative, so this would come up again when the potential energy reference can change.
I verified that this line of code near the numToDraw
calculation in PieChartWebGLSliceNode makes the warning go away:
numToDraw = Math.min( numToDraw, this.vertices.length / 2 );
But we are still running into a case with negative potential energy, which will need to be address in #432.
@KatieWoe can you please verify that the original issue has been fixed?
Looks good on Master.
Thanks!
Test device: Dell Laptop Operating System: Windows 10 Browser: Chrome 67.0.3396.99 Problem description: For phetsims/QA/issues/134 Possibly related to phetsims/energy-skate-park-basics/issues/177 It is possible to make the skater skate fully underground while they are still on the track. If this happens while the Pie Chart checkbox is selected, the pie chart will darken partially or entirely while the skater is underground. Steps to reproduce:
Screenshots:![dark graph](https://user-images.githubusercontent.com/41024075/43013864-7d901a14-8c07-11e8-8921-c1ca0b88065b.gif)
Troubleshooting information (do not edit):