singodiyashubham87 / Draw-it-out

An online Whiteboard application built using ReactJS & TailwindCSS utilising the HTML5 Canvas & the JavaScript Canvas API.
https://draw-it-out.vercel.app
MIT License
84 stars 151 forks source link

Enhancement Proposal: Snap-to-Grid and Alignment Guides #296

Open Akash4701 opened 1 month ago

Akash4701 commented 1 month ago

Feature Description: Introduce a feature that allows users to toggle a grid overlay on and off, implement snap-to-grid functionality for precise element positioning, and provide alignment guides to help users align elements relative to one another.

Steps to Implement:

Add Grid Option:

Grid Toggle Button: Add a toggle button in the whiteboard settings menu to enable or disable the grid overlay. Customization Options: Allow users to customize the grid by adjusting grid spacing, line color, and opacity. Implement Snap-to-Grid Functionality:

Snap Elements to Grid: When the grid is enabled, elements such as shapes and text boxes should snap to the nearest grid lines when moved or resized. Snap Toggle Option: Provide an option for users to turn the snap-to-grid feature on or off based on their needs. Add Alignment Guides:

Visual Alignment Guides: Display alignment guides (dashed lines) when an element is moved near another element to indicate alignment with the center or edges. Snap to Alignment Guides: Enable elements to snap to these alignment guides to ensure precise alignment with other elements on the canvas. User Experience Flow:

Enable Grid: Users access the whiteboard settings and toggle the grid option. The grid appears on the canvas with user-defined customization settings. Snap Elements: As users drag or resize elements, the elements snap to the nearest grid line if the snap-to-grid feature is enabled. Show Alignment Guides: When users move an element close to another element, alignment guides appear. Elements snap to these guides, ensuring they are aligned centrally or along the edges with other elements. Expected Benefits:

Enhanced Precision: Users can create neatly aligned and evenly spaced designs without the need for meticulous manual adjustments. Increased Efficiency: Snap-to-grid and alignment guides save time by automating the positioning process. Professional Results: The resulting drawings look more polished and organized, making them suitable for professional presentations or detailed designs. Expected Outcome: By implementing this enhancement, users will benefit from an improved drawing experience that includes grid overlays, snap-to-grid functionality, and alignment guides. These features will help users achieve more precise and organized

Akash4701 commented 1 month ago

Please assign me this issue @singodiyashubham87 for SSoC'2024

singodiyashubham87 commented 4 weeks ago

@Akash4701 Can you show me prototype/screenshot?

Akash4701 commented 4 weeks ago

Yes,I can tell what are the advantages of making the grid like system in this grid like system. 1.first in this picture,the below diagram to ensure a even layout and alignment of the boxes. Screenshot 2024-06-06 021128

2.to ensure a proper layout of the circles in a order. Screenshot 2024-06-06 021332 Screenshot 2024-06-06 021332

  1. A small Prototype for this;- Screenshot 2024-06-06 021313

    4.A toggle switch type for removing the grid type when it's necessary or when the alignment part is completed. Screenshot 2024-06-06 021640

i think, i am able to make you understand the advantages of this system and a rough diagram to show it.

singodiyashubham87 commented 4 weeks ago

@Akash4701 Nice, How are you going to implement this?