openpencil/packages/core/src
Danila Poyarkov 69dbc36a7e
fix: match Figma when dragging, drawing, duplicating, and pasting (#894)
* fix: match Figma when dragging, drawing, duplicating, and pasting

Checked against Figma desktop 126 with real pointer input. A dragged layer
lands in the topmost unlocked frame, section, component, or instance under
the cursor, following rotation and clipping, and leaves its frame as soon as
the cursor does; groups, boolean operations, component sets, and locked
frames never take a drop, and a layer stays in its group unless it lands on
another frame. Space keeps parents, Shift locks an axis, and Control drops
into auto layout as an absolute-positioned layer. Locked layers stay put.

New shapes go into the frame under the start point, frames and sections take
in the unlocked siblings they fully cover, duplicates land in place (top-level
frames to the right), and paste keeps the copied position, centering an axis
that does not fit the selected frame.

* fix: match Figma for drag edge cases with components, groups, and auto layout

A second round of checks against Figma desktop 126, replaying the same
pointer input in both editors. A component set takes back only its own
variants, and components never go into other components. Groups and
booleans refit their children after a move or nudge, and a group whose
last layer leaves is removed. Pressing inside a selected frame, group, or
component set drags it instead of the layer under the cursor.

Auto layout children dragged out land where they are dropped, drawing
inside auto layout adds to the end of the flow, and wrapped frames insert
on the line under the cursor. Duplicates keep their names, and a main
component duplicates as an instance with Cmd+D or Alt-drag; a multi-layer
duplicate stays in place, and a lone frame in a section counts as
top-level.

* fix(core): refuse new shapes in the locked part of an instance

createShape redirected a refused parent through acceptingParent while keeping coordinates in the original parent's space, and still inserted the layer when the slot claim failed. It now takes the given parent, claims a slot when needed, and throws when the parent refuses children; drawing skips such parents before creating anything.
2026-10-05 12:39:03 +00:00
..
cache refactor(canvas): share bounded resource cache bookkeeping 2026-09-15 21:28:16 +03:00
canvas feat: create, fill, and edit slots (#862) 2026-10-04 17:02:28 +00:00
clipboard fix: validate parsed JSON at untrusted boundaries with Valibot (#855) 2026-10-04 17:01:50 +00:00
design-jsx feat: preview streamed JSX on the canvas (#692) 2026-10-01 10:52:36 +04:00
editor fix: match Figma when dragging, drawing, duplicating, and pasting (#894) 2026-10-05 12:39:03 +00:00
figma-api chore: prefer es-toolkit helpers and lint the mechanical cases (#898) 2026-10-05 09:34:00 +00:00
geometry feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
icons fix(core): fill open subpaths of filled SVG paths (#876) 2026-10-04 13:25:23 +00:00
io chore: prefer es-toolkit helpers and lint the mechanical cases (#898) 2026-10-05 09:34:00 +00:00
kiwi feat(scene-graph)!: let a SceneGraph take its ID generator (#887) 2026-10-05 08:21:22 +00:00
layout fix(core): show imported page backgrounds and stop fixed text collapsing 2026-10-02 12:10:06 +04:00
library refactor: define OpenPencil plugin data in one typed registry (#878) 2026-10-04 17:32:18 +00:00
lint chore: prefer es-toolkit helpers and lint the mechanical cases (#898) 2026-10-05 09:34:00 +00:00
profiler perf(canvas): rebuild navigation rendering (#591) 2026-08-31 13:39:40 +03:00
rpc feat: write variables as a CSS token stylesheet (#856) 2026-10-04 18:15:52 +00:00
text refactor!: register HTML and Tailwind JSX as IO formats (#774) 2026-09-26 11:54:16 +04:00
tools feat(app): record runtime errors in diagnostics and make events readable (#874) 2026-10-05 07:59:44 +00:00
vector chore: prefer es-toolkit helpers and lint the mechanical cases (#898) 2026-10-05 09:34:00 +00:00
canvaskit.ts
clipboard.ts feat(scene-graph)!: let a SceneGraph take its ID generator (#887) 2026-10-05 08:21:22 +00:00
constants.ts fix: match Figma when dragging, drawing, duplicating, and pasting (#894) 2026-10-05 12:39:03 +00:00
global.d.ts fix(figma-api): validate effects like Figma (#794) 2026-09-30 21:18:20 +04:00
index.ts feat(scene-graph)!: let a SceneGraph take its ID generator (#887) 2026-10-05 08:21:22 +00:00
layout.ts fix(core): show imported page backgrounds and stop fixed text collapsing 2026-10-02 12:10:06 +04:00
xpath.ts