clementmihailescu / Pathfinding-Visualizer

A visualization tool for various pathfinding algorithms.
1.69k stars 499 forks source link

Made some changes to improve user experience. Read the comment for more. #10

Open Nirmal-Palanichamy opened 3 years ago

Nirmal-Palanichamy commented 3 years ago

First of all... Big fan Clement! :)

I love this project. But, when I was checking out the project, it felt a little buggy while creating walls. So I've added these 3 features to make it better:

  1. Disabled right click context menu within board. Previously, right click on the board would open up the context menu. This is unnecessary and so it is disabled.
  2. Separated left and right mouse button functionalities. Previously, both left and right mouse buttons could add as well as delete walls. Now, left mouse button will only be able to add walls and right mouse button will only be able to delete walls.
  3. Added mouseup and mousedown functions on body. Previously, when creating walls, it seemed to be kind of buggy. Also, when the user drags out of the page, on bringing the cursor back, it would continue to create walls. Now, mouseup function has been added to body to reduce buggy feeling and also, mouseleave function has been added to stop creating walls after leaving the page and returning back. NOTE: This was only done for normal elements and NOT special elements.

Let me know if I need to change anything before this can be merged. Cheers :)

Nirmal-Palanichamy commented 3 years ago

You can try it out here: https://nirmal-palanichamy.github.io/Pathfinding-Visualizer/