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

Feature to editMode: Add and Delete nodes #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BasaX
Copy link

@BasaX BasaX commented Oct 8, 2024

Description

I've used the application and I've noticed that I didn't have the possibility of adding or deleting nodes from a created polygon, I found it an interesting addition that can improve the user experience so I worked on it.

I've added these changes to the editing mode, first I added a check on the letter ctrl to the mousedown event, if it's pressed and a node is clicked, it adds a new one. To achieve this I identify the current node and the next one, then I calculate the distance between them and add the node in the center, once this is done I redraw the lines to connect them and update the canvas.
Then I have added a check on the alt key, if it is pressed and you click on a node, it deletes it

Type of change

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

I tested it on several ways running with live server and I've ensured the previous functinalities of the editMode still works.

Any specific deployment considerations

None that I can think of

Docs

  • Docs updated? What were the changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant