Skip to main content

Module clipboard

Module clipboard 

Source
Expand description

Copy, cut, and paste, as the drawing surface sees them.

The payload model itself lives in crate::edit::clipboard — a value snapshot of the copied closure with the gesture that made it, versioned as Clipboard::V2 and carried over the OS clipboard as JSON. This module is the Drawing side: which selection a gesture copied, where a paste lands, and the emitter call each turns into. Nothing here decides what a copy contains — that is the delete closure’s own walk, shared so a cut and a delete cascade agree.

Constants§

UNTARGETED_OFFSET 🔒
The whole-cell diagonal a targetless paste lands at, so a duplicate never hides the original it was copied from.

Functions§

copy_target 🔒
The entity a copied shape names. An icon has none: it is a value on its block, and travels with it.
is_object_clipboard
Whether text is a copied selection rather than plain text to insert into a focused editor.
pasted_shape 🔒
What the tools name a pasted root.