feat(text-tool): implement Photoshop-style on-canvas text editor
- Replaced modal dialog with inline on-canvas text editor - Text objects stored as editable entities (non-rasterized) - Live preview with transparent textarea overlay - Click on existing text to re-edit - Drag transform handles to move text - Auto-commit on click outside (via overlay) - Text selection with visible highlight - Hidden original text during editing to prevent double vision - Position alignment fixes for editing existing text - Keyboard shortcuts: Ctrl+Enter to commit, Escape to cancel 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -18,9 +18,18 @@ export class TextTool extends BaseTool {
|
||||
const layer = this.getActiveLayer();
|
||||
if (!layer) return;
|
||||
|
||||
// Open text dialog at click position
|
||||
const { openDialog } = useTextStore.getState();
|
||||
openDialog(pointer.x, pointer.y);
|
||||
const { activateOnCanvasEditor, getTextObjectAt } = useTextStore.getState();
|
||||
|
||||
// Check if clicking on existing text object
|
||||
const existingText = getTextObjectAt(pointer.x, pointer.y, layer.id);
|
||||
|
||||
if (existingText) {
|
||||
// Edit existing text
|
||||
activateOnCanvasEditor(pointer.x, pointer.y, existingText.id);
|
||||
} else {
|
||||
// Create new text
|
||||
activateOnCanvasEditor(pointer.x, pointer.y);
|
||||
}
|
||||
}
|
||||
|
||||
onPointerMove(): void {
|
||||
|
||||
Reference in New Issue
Block a user