Skip to main content

Module canvas

Module canvas 

Source
Expand description

The diagram’s element, and everything the browser tells it.

Every handler here does one thing: it turns a DOM event into a sample or an Event and hands it to the shell. What a drag means — a pan, a tool’s gesture, a click — is the backend’s Reader and the kernel’s, not this element’s.

Re-exports§

pub use Canvas_completions::Component::Canvas;

Structs§

CanvasProps
Properties for the Canvas component.

Functions§

Canvas
The canvas, filling the diagram’s part of the page.
clipped_on 🔒
A copy or a cut anywhere but a field takes the selection, when there is one to take — and is otherwise left to the browser.
dragged 🔒
Where the drag is, told to the editor as a motion — so what it drops lands under it rather than wherever the pointer was before the browser took it for the drag (dom::dragged).
kept_by_a_control 🔒
Whether a control took the key. A menu takes Escape — and says so even while it is closed, when there is nothing for it to close; the key is then the drawing’s.
keyed 🔒
A keystroke the canvas reads, or a chord this call has a command for. Everything else is left to the browser.
keyed_by 🔒
A keystroke anywhere on the page. A field being typed into keeps its own keys, and so does a control that took one for itself.
listens
The page’s keyboard and clipboard, read for the drawing at the document rather than on any element this app renders: with nothing focused, a key is aimed at <body>, above all of them. The listeners are the page’s, and end with the tab.
opened_around 🔒
Whether the event came from inside something open. The attribute still says what it was before this key: the page re-renders after the event.
pasted_on 🔒
A paste anywhere but a field is an object paste — as the egui shell takes one.
pointed 🔒
pointed_by 🔒
typed_into 🔒