Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tangent can return to default position in launched sim #310

Closed
Nancy-Salpepi opened this issue Mar 23, 2023 · 6 comments
Closed

Tangent can return to default position in launched sim #310

Nancy-Salpepi opened this issue Mar 23, 2023 · 6 comments

Comments

@Nancy-Salpepi
Copy link

Test device
MacBook Air M1 chip

Operating System
13.2.1

Browser
Safari/FF/Chrome

Problem description
For phetsims/qa#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

Tangentlinedefault.mp4
@pixelzoom
Copy link
Contributor

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

@veillette
Copy link
Contributor

veillette commented Mar 23, 2023

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
Copy link
Contributor

veillette commented Mar 23, 2023

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

@pixelzoom
Copy link
Contributor

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
Copy link
Author

Nancy-Salpepi commented Mar 24, 2023

Thanks @pixelzoom!
This looks good in master now.

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

@pixelzoom
Copy link
Contributor

👍🏻 closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants