phetsims / calculus-grapher

"Calculus Grapher" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 4 forks source link

Tangent can return to default position in launched sim #310

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 1 year ago

Test device MacBook Air M1 chip

Operating System 13.2.1

Browser Safari/FF/Chrome

Problem description For https://github.com/phetsims/qa/issues/921, on the Derivative Screen, after creating a curve on the left side of the graph and turning on Tangent, the Tangent line will be along the curve and not on the x-axis. When I launch the sim, the Tangent is in its default position along the x-axis.

Steps to reproduce

  1. On the Derivative Screen, create a curve so that the Tangent, when turned on, will be on the curve.
  2. Check the Tangent checkbox.
  3. Launch the sim.

Visuals

https://user-images.githubusercontent.com/87318828/227216078-81751452-258d-42ee-8856-d84809c81727.mp4

pixelzoom commented 1 year ago

I'll have a look. This is similar to #307 -- a tool that is in the wrong initial position when state is restored.

veillette commented 1 year ago

I was able to reproduce. After setting the state, I'll note that modifying the curve does not update the position of the tangent arrow. However, as soon as one modifies the x-position of the scrubber the tangent arrow updates itself to the correct position.

veillette commented 1 year ago

And we can observe the same bug with the State Wrapper. image

pixelzoom commented 1 year ago

Fixed in the above commit. As I suspected, this issue and #307 were the same underlying problem, shared by all tools. Great find @Nancy-Salpepi! Please verify in master.

Nancy-Salpepi commented 1 year ago

Thanks @pixelzoom! This looks good in master now.

EDIT: this also fixed the same issue with the point for Area Under Curve

pixelzoom commented 1 year ago

👍🏻 closing.