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:

@lrosemberg lrosemberg self-requested a review November 27, 2024 21:33
Copy link

@lrosemberg lrosemberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @BasaX,

Thank you so much for your contribution! This looks like a great feature.

I noticed that you ran the linter for the project, which changed the indentation, quotes, and other code styles. Could you submit a commit with only the actual changes, excluding the code style adjustments? This would make it much easier to review what was modified.

Thank you!

@lrosemberg lrosemberg added the enhancement New feature or request label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants