Skip to content

feat(canvas): implement image element with drag-and-drop, clipboard paste, and canvas rendering - #39

Merged
shadowmkj merged 2 commits into
mainfrom
feat/image-element
Nov 14, 2026
Merged

shadowmkj merged 2 commits into
mainfrom
feat/image-element

Conversation

@shadowmkj

Copy link
Copy Markdown
Owner

Summary

This pull request introduces full support for raster and vector image elements within the canvas engine. Users can now seamlessly import images via drag-and-drop from the file system or by pasting directly from the system clipboard, backed by an optimized image loading, downscaling, and caching pipeline.

Resolves: #28

Key Changes

  • Image Element Support: Added ImageElement type to the canvas architecture supporting position, scaling, opacity, natural dimensions, and aspect ratio locking.
  • Drag-and-Drop & Clipboard: Implemented robust file drop handling on the canvas viewport and system clipboard paste support for image blobs/files.
  • Optimized Image Pipeline: Created optimizeImageBlob to handle high-resolution downscaling (capping to 2560px), non-blocking object URL decodes, and imageCache pre-loading.
  • Canvas Rendering: Added image rendering with asynchronous load fallbacks, bounding boxes, and performance culling in CanvasRenderer.
  • Testing: Added comprehensive integration and unit tests for clipboard operations and canvas drag-and-drop image workflows.

Verification & Testing

  • Ran unit and integration test suites covering image clipboard paste and canvas drag-and-drop:
    • src/core/clipboard/clipboard.test.ts
    • src/core/engine/CanvasRenderer.test.ts
    • src/components/canvas/CanvasViewportDragDrop.test.tsx
    • src/AppImportIntegration.test.tsx

…aste, and canvas rendering (#28)

fix(canvas): resolve image re-rendering and caching issues after element deletion
@shadowmkj
shadowmkj merged commit 1eb5f97 into main Nov 14, 2026
5 checks passed
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.

Image element support: Drag-and-drop import, clipboard copy & paste, and canvas rendering (like Excalidraw)

1 participant