Skip to content

Conversation

@Abdo-Eid
Copy link

Summary

  • Refactors and modularizes the 2D floor implementation. Replaces the monolithic src/js/2d/floor2d.js with modular files to improve maintainability and performance.
  • Adds new features: Move tool (Alt to drag vertices or drag canvas), extended context menu actions (Delete Line, Clear Canvas), and improved hints UI.
  • Fixes canvas resize issues when toggling between 2D/3D and improves panning stability and grid behavior.

Testing checklist (please run before merging)

  • Start dev server and open the app in 2D mode
  • Create and edit lines/shapes using drawing tools
  • Use the Move tool: hold Alt and drag vertices — ensure vertices move and shapes update
  • Right-click on canvas to open context menu: verify 'Delete Line' and 'Clear Canvas' actions work
  • Toggle between 2D and 3D modes — verify canvas resizes properly and no JS errors appear
  • Load a DXF file (use simple_test.dxf) — verify entities render and behave correctly
  • Confirm grid and panning behavior for large canvases (infinite grid behavior)

Notes for reviewers

  • undo code of amer @iamAmer is removed for now, I'm working on undo redo feature that uses command pattern, but still thinking of a good structure.
    @pcolt @mfranzon

- Added close button to hints for better UX
- Improved context menu handling and grid resizing
- Prevented default browser context menu interference
- Added move tool with Alt modifier for vertex dragging
- Implemented infinite grid (GPU-accelerated via Paper.js)
- Fixed canvas resize issues when toggling 2D/3D modes
- Split monolithic code into modules
- Improved panning stability and performance
- Added 'Delete Line' and 'Clear Canvas' options to context menu
- Improved user workflow for canvas management
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