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

Mismatched parameters in DerivedProperty #128

Closed
samreid opened this issue Mar 26, 2024 · 1 comment
Closed

Mismatched parameters in DerivedProperty #128

samreid opened this issue Mar 26, 2024 · 1 comment
Assignees

Comments

@samreid
Copy link
Member

samreid commented Mar 26, 2024

During code review #103, we observed In FieldMeasurementTool:

    // This needs to be a new Vector2 instance, so do not pass an output vector to magnet.getFieldVector.
    this.fieldVectorProperty = new DerivedProperty(
      [ this.positionProperty, magnet.positionProperty, magnet.rotationProperty, magnet.strengthProperty ],
      ( position, rotation, strength ) => magnet.getFieldVector( position ), {

Note that the 2nd dependency in the array is position, but the 2nd parameter in the callback is rotation.

@pixelzoom
Copy link
Contributor

Fixed in 839fdd5. 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

2 participants