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

Duplicated drag function #379

Closed
pixelzoom opened this issue Mar 15, 2022 · 1 comment
Closed

Duplicated drag function #379

pixelzoom opened this issue Mar 15, 2022 · 1 comment
Assignees

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Mar 15, 2022

For #374

This is duplicated in 4 draggable Nodes. Can it be factored out? Is it worth it?

    // Drag action that is common to DragListener and KeyboardDragListener
    const drag = () => {
      wasDraggedProperty.value = true;
    };
@pixelzoom pixelzoom self-assigned this Mar 15, 2022
@pixelzoom pixelzoom changed the title Factor out duplicate drag function? Duplicated drag function Mar 15, 2022
@pixelzoom
Copy link
Contributor Author

Two of these occurrences where in subclasses of OpticalObjectNode, so those were moved into that base class.

The other two occurrences are in SecondPointNode and ProjectionScreenNode, both of which extend Node. I decided to leave those alone.

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

1 participant