()
| 630 | } |
| 631 | |
| 632 | const handleSave = () => { |
| 633 | // 先应用所有文本 |
| 634 | if (textItems.length > 0) { |
| 635 | applyTextsToCanvas() |
| 636 | } |
| 637 | |
| 638 | const canvas = canvasRef.current |
| 639 | if (!canvas) return |
| 640 | |
| 641 | const editedImageUrl = canvas.toDataURL('image/png') |
| 642 | onSave(editedImageUrl) |
| 643 | } |
| 644 | |
| 645 | const canUndo = currentHistoryIndex > 0 |
| 646 | const canRedo = currentHistoryIndex < history.length - 1 |
nothing calls this directly
no test coverage detected