phetsims / hookes-law

"Hooke's Law" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 4 forks source link

reuse of code for point tool #61

Closed pixelzoom closed 6 years ago

pixelzoom commented 6 years ago

Graphing Lines has a point tool that looks like this: screenshot_717

Graphing Quadratics has a point tool that is similar, but has a different "crosshair" sensor: screenshot_718

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?

arouinfar commented 6 years ago

@pixelzoom I think you have the wrong repo.

pixelzoom commented 6 years ago

Oops, thanks @arouinfar. Guess I'm working on too many things at once :)

Moved to https://github.com/phetsims/graphing-quadratics/issues/18.