Closed pixelzoom closed 3 years ago
This can certainly be done, but it a new issues.
@amanda-phet is this something that you want done? And do you want it for the 1.2 release?
EDIT: I recommend that we do this.
Note to self...
This involves taking this bit of code from PointToolNode.PointToolDragListener
:
// We will be snapping the x value as it will be displayed by the point tool.
// See See https://github.com/phetsims/graphing-quadratics/issues/169.
let x = Utils.toFixedNumber( position.x, GQConstants.POINT_TOOL_DECIMALS );
...
const y = snapQuadratic.solveY( x );
position = new Vector2( x, y );
... and adapting it to PointOnParabolaManipulator.PointOnParabolaDragListener
. Be sure to use GQConstants.POINT_ON_PARABOLA_DECIMALS
instead of GQConstants.POINT_TOOL_DECIMALS
.
I think we should make this change since the goals of the point on parabola are very similar to the point tool.
Done in master and 1.2 branches. @amanda-phet please review in master.
Looks great!
Ready for testing in the next RC. To verify:
I was unable to find any instances where the same x value had multiple y values. When the y coordinate value changed, so did the x value.
In https://github.com/phetsims/graphing-quadratics/issues/169#issuecomment-909518229, @stemilymill reported: