Convert#1
Conversation
…ules, and initialize WASM support
…lobal styling, and workspace layout components
…ypto, dummy, and drawing utilities
… layout components
… for shape and freehand rendering
…nd element manipulation
…yle configuration support
…ipulation, and rendering support
…ng and selection support
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d94cf661bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (current.type === 'freehand') current.points = [...(current.points || []), { x, y }]; | ||
| else { current.x2 = x; current.y2 = y; } |
There was a problem hiding this comment.
Update freehand bounds while drawing
Freehand strokes never update x2/y2 as points are added, so their stored bounding box stays at the initial click point. Any feature that relies on element bounds (e.g. getHandleAtPosition and marquee selection in handleMouseUp) will behave incorrectly for freehand drawings, making them hard or impossible to resize/select unless the start point happens to fall inside the interaction area.
Useful? React with 👍 / 👎.
| if (action === 'moving' && selectedElementIds.length > 0) { | ||
| const dx = (e.clientX - startPanPos.x) / scale; | ||
| const dy = (e.clientY - startPanPos.y) / scale; | ||
| setElements(prev => prev.map(el => selectedElementIds.includes(el.id) ? { ...el, x1: el.x1 + dx, y1: el.y1 + dy, x2: el.x2 + dx, y2: el.y2 + dy, points: el.points?.map(p => ({ x: p.x + dx, y: p.y + dy })) } : el)); | ||
| setStartPanPos({ x: e.clientX, y: e.clientY }); |
There was a problem hiding this comment.
Record history before move/resize mutations
Move and resize paths mutate elements directly on mouse movement but never push a pre-change snapshot to history, while undo relies entirely on that stack. In practice, after dragging or resizing objects, pressing Undo will not revert the latest transform, which breaks expected editor behavior and makes accidental transforms hard to recover from.
Useful? React with 👍 / 👎.
| const newEl: Element = { | ||
| id, x1: x, y1: y, x2: x, y2: y, type: tool, color, strokeWidth, zIndex: elements.length, | ||
| points: tool === 'freehand' ? [{x, y}] : undefined | ||
| }; |
There was a problem hiding this comment.
Implement eraser behavior instead of creating inert elements
When the eraser tool is active, mouse down falls through the generic drawing branch and creates an element with type: 'eraser'. Since rendering and hit logic have no eraser handling, this action neither draws visible output nor removes existing objects, so the advertised eraser tool is effectively non-functional.
Useful? React with 👍 / 👎.
Description
This pull request introduces a professional-grade, node-based vector design environment to the project. It transforms the basic whiteboard into a sophisticated design tool with support for multi-object management, proportional scaling, and professional drafting.
Key Enhancements:
scale/offset).Fixes # (Optimizing Vector Drawing Toolset & Interaction Logic)
Type of change
How Has This Been Tested?
Delete,Backspace,Shift+Scroll) for design efficiency.Checklist: