-
Notifications
You must be signed in to change notification settings - Fork 4
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
Free-Form and discontinuities with small numberOfPoints #276
Comments
The problem lies with the way we go about assigning discontinuities. private drawFreeformToPosition( position: Vector2,
penultimatePosition: Vector2 | null,
antepenultimatePosition: Vector2 | null ): void { but we assign the discontinuities with if ( lastPoint.x > closestPoint.x ) {
this.getClosestPointAt( position.x - this.deltaX ).pointType = 'discontinuous';
}
else {
this.getClosestPointAt( position.x + this.deltaX ).pointType = 'discontinuous';
}
|
The way forward is to assign the type after we assign the y values. |
Some progress. The following works as long as the drag is unidirectional.
We need to handle the case where the drag changes direction. |
Signed-off-by: Martin Veillette <martin.veillette@gmail.com>
I committed the piece of code above about the tagging of pointType. There is more work to do on it, which I plan to finish today. |
Signed-off-by: Martin Veillette <martin.veillette@gmail.com>
Signed-off-by: Martin Veillette <martin.veillette@gmail.com>
Hmm, I have resolved the issue but code-wise, I am not very happy with the result. It has gotten too complicated.
I'll need to simplify the logic. |
I need to add more documentation that goes beyond explaining the logic but the overall objective of tagging the pointType. |
Signed-off-by: Martin Veillette <martin.veillette@gmail.com>
Given that we just finished a dev test (phetsims/qa#921) I think it is safe to leave the code base as it is. I added some documentation for future maintainers. |
This issue becomes more prominent as the numberOfPoints is lowered.
While dragging (slowly) with free form, one sees only discontinuities.
for numberOfPoints=50, we can observe
Repeating with the default number of points, we can also generate discontinuities, if dragging very, very slowly. (It is much harder to reproduce, one must drag very slowly)
The text was updated successfully, but these errors were encountered: