-
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
reuse of code for point tool #18
Comments
Mentioning @ariel-phet, in case he has an opinion about this. |
@pixelzoom @amanda-phet I would be fine with using the same style both, except for one "point". One tool goes to integer values, one is a bit more of "trace" tool. I don't think this is necessarily a massive or important distinction, and I think the UX will be fine either way. |
The two tools have different behaviors, so the different styles make sense to me. The point tool in GL snaps to integer coordinates, and the point tool in GQ is more continuous. However, I am fine with option (1) if it is the best option from a development perspective. |
I'm starting to lean towards (3), live with duplication. Graphing Lines dealt with straight lines, and the point tool therein doesn't know how to deal with curved lines (like quadratics). And rather than try to make it deal with curved lines, I'm inclined to create a new point tool in Graphing Quadratics that handles both curved and straight lines. |
I've decided not to reused PointToolNode. And in fact, I'm going to create a PointTool (model element) that is specific to Graphing Quadratics, because the one in Graphing Lines is (not surprisingly) specific to straight lines. Closing. |
Graphing Lines has a point tool that looks like this:
![screenshot_717](https://user-images.githubusercontent.com/3046552/44418354-6455e280-a535-11e8-87d7-54ab133a2be3.png)
Graphing Quadratics has a point tool that is similar, but has a different "crosshair" sensor:
![screenshot_718](https://user-images.githubusercontent.com/3046552/44418387-7df72a00-a535-11e8-92c7-78446647c0f7.png)
To implement the point tool in Graphing Quadratics,
PointToolNode
was copied from graphing-quadratics, then modified, with this TODO in the code://TODO Copied from GRAPHING_LINES/common/view/PointToolNode
The implementations are very similar, but factoring something out to be used by both graphing-lines and graphing-quadratics would be a bit forced/unnatural.
Options:
(1) Use the new design in both graphing-quadratics and graphing-lines.
(2) Factor out common code, even if it's forced/unnatural.
(3) Live with code duplication.
Option (1) is best, if that's acceptable to the designer. @amanda-phet what do you think?
The text was updated successfully, but these errors were encountered: