Package-level declarations
Types
Repeating image painted behind drawing elements, sitting on top of the solid State.bgColor but underneath all strokes and shapes.
Keys for the SDK's built-in font families. Hosts can register additional families via the controller; these three are always available.
Resize handle positions around a selected element's bounding box. Eight handles in total: four corners and four edge midpoints.
Defines how Element.Shape is rendered on the canvas.
Represents the complete immutable state of the drawing canvas.
Stroke pattern applied when rendering a stroked (non-filled) Element.Shape.
Horizontal alignment inside an Element.Text's wrap box.
Per-tool snapshot captured by State.toolMemory. Restored to State's top-level style fields when the user swaps back to a tool.
Properties
Default font family key used when no Element.Text.fontFamilyKey is specified and as the fallback when a referenced key isn't registered.
The mode currently driving user input. Equals State.mode unless the user is holding the space bar (or has otherwise activated a temporary pan), in which case it returns Mode.PAN. The original State.mode is preserved so release of the temp-pan modifier restores the previous tool.
The spatial positions of every sample in a freehand stroke, in order. Use this when the caller only cares about geometry (bounds, hit testing, path tessellation); reach for Element.Path.samples directly when widths are also needed.
Functions
Angle in degrees from center to pointer measured from the positive x-axis, clockwise positive (matching Compose's rotation direction).
World-space point on the curve at t = 0.5 — the spot where the bend handle sits.
Point on this shape's outline closest to the ray from the shape's center toward target. Used by arrow connectors to terminate at the boundary instead of sinking into the shape.
World-space attachment point for an arrow connector binding to this shape.
Quadratic-bezier control point for a curved ShapeType.LINE / ShapeType.ARROW.
Whether mode participates in State.toolMemory save/restore on Intent.SetMode.
Compute new bounds when dragging handle of originalBounds to world-space pointer pointer. The opposite corner / edge midpoint stays anchored in world space, even when the element is rotated.
Type-aware variant of resizeBounds. The returned bounds is sized so that element.withBounds(returnedBounds).bounds() == returnedBounds — i.e., no second-pass snapping inside withBounds can shift the result.
Encode a Element.PathSample as a comma-separated string. Chosen over a JSON-object form to keep PEN strokes (which can have thousands of samples) small on the wire.
Scale points so the bounding box matches newBounds. For two-point shapes this snaps start/end to the new bbox corners (preserving orientation of the original drag direction). For freedraw paths every point is scaled linearly. Rotation unchanged.
Absolute rotation in degrees.