Find a file
Danila Poyarkov 86a5edfab5 Reuse Paint objects instead of allocating per frame
Pre-allocate auxFill, auxStroke, and opacityPaint on the renderer.
Reconfigure them before each use instead of new/delete cycles.
Reduces per-frame WASM Paint allocations from 29 to 10 (the
remaining 10 are cold-path: pen tool, rulers, one-off overlays).

Hot paths covered: renderNode opacity layers, hover/drop highlights,
selection handles (called 8-16× per frame), section title pills,
component label icons+text, size pill, marquee, layout indicator,
rotation handle, component set dashed border, drop shadows.
2026-02-28 19:19:30 +03:00
.vscode Initial commit: Tauri + CanvasKit + React editor scaffold 2026-02-27 15:48:29 +03:00
desktop Format Rust code with rustfmt 2026-02-28 16:24:31 +03:00
public Fix .fig import/export round-trip 2026-02-28 15:12:24 +03:00
src Reuse Paint objects instead of allocating per frame 2026-02-28 19:19:30 +03:00
tests Add fig-import unit tests for Tier 1 rendering features 2026-02-28 16:43:43 +03:00
.gitignore Pages support: multi-page documents like Figma 2026-02-28 13:12:27 +03:00
.oxfmtrc.json Add oxlint, oxfmt, typescript-go 2026-02-27 15:52:55 +03:00
bun.lock Zstd compression via Tauri Rust command, deflate fallback for browser 2026-02-28 14:56:06 +03:00
COMPARISON.md Fix text disappearing on window resize 2026-02-28 19:08:16 +03:00
components.d.ts Fix context menu not showing: scoped slot pattern + icon fix 2026-02-28 18:10:26 +03:00
index.html Migrate React → Vue 3 + VueUse + Reka UI 2026-02-27 21:25:31 +03:00
oxlint.json Rename src-tauri → desktop, symlink for CLI compat 2026-02-28 08:10:09 +03:00
package.json Zstd compression via Tauri Rust command, deflate fallback for browser 2026-02-28 14:56:06 +03:00
PLAN.md Add full keyboard shortcut reference to PLAN.md, fix zoom speed 2026-02-27 23:10:27 +03:00
playwright.config.ts Skip stability check: toMatchSnapshot, 2.1s → 1.3s 2026-02-28 07:44:20 +03:00
README.md README: add cargo install tauri-cli step 2026-02-28 10:05:25 +03:00
tsconfig.json Fix production build type errors 2026-02-28 11:37:02 +03:00
tsconfig.node.json Initial commit: Tauri + CanvasKit + React editor scaffold 2026-02-27 15:48:29 +03:00
vite.config.ts Add IconsResolver for auto-import, explicit imports only for dynamic maps 2026-02-28 08:29:39 +03:00

OpenPencil

Open-source, AI-native design editor. Figma alternative built from scratch with full .fig file compatibility.

Status: Active development. Not ready for production use.

Features

  • Figma .fig file import — open native Figma files directly
  • Figma clipboard — copy/paste between OpenPencil and Figma
  • Vector networks — complex boolean shapes and open paths, like Figma
  • Auto-layout — constraint-based layout matching Figma behavior
  • Pen tool — bezier curves with tangent handles
  • Inline text editing — multi-line text with Inter font
  • Undo/redo — all operations are undoable
  • Snap guides — edge and center snapping
  • Color picker — HSV, hue/alpha sliders, hex input

Tech Stack

Layer Tech
UI Vue 3, VueUse, Reka UI
Styling Tailwind CSS 4
Rendering Skia (CanvasKit WASM)
Layout Yoga WASM
File format Kiwi binary (vendored) + Zstd + ZIP
Color culori
Desktop Tauri v2
Testing Playwright (visual regression), bun:test (unit)
Tooling Vite 7, oxlint, oxfmt, typescript-go

Getting Started

bun install
bun run dev

Scripts

Command Description
bun run dev Dev server at http://localhost:1420
bun run build Production build
bun run check Lint + typecheck
bun run test E2E visual regression
bun run test:update Regenerate screenshot baselines
bun run test:unit Unit tests
bun run tauri dev Desktop app (requires Rust)

Desktop App

Requires Rust, the Tauri CLI, and platform-specific prerequisites (Tauri v2 guide).

cargo install tauri-cli --version "^2"
bun run tauri dev                      # Dev mode with hot reload
bun run tauri build                    # Production build
bun run tauri build --target universal-apple-darwin  # macOS universal

Cross-compilation to other platforms requires their respective toolchains or CI (e.g. GitHub Actions).

Project Structure

src/
  components/     Vue SFCs (canvas, panels, toolbar, color picker)
  composables/    Canvas input, keyboard shortcuts, rendering
  stores/         Editor state (Vue reactivity)
  engine/         Scene graph, renderer, layout, clipboard, undo, vector, snap
  kiwi/           Figma file format (Kiwi codec, .fig import)
    kiwi-schema/  Vendored from evanw/kiwi
  types.ts        Shared types
  constants.ts    UI colors, defaults, thresholds
desktop/          Tauri v2 (Rust + config)
tests/
  e2e/            Playwright visual regression
  engine/         Unit tests

License

MIT