Skip to main content

Crate renamite_behavior_common

Crate renamite_behavior_common 

Source
Expand description

Shared context for tool behaviors: selection, view transform, snapping.

Modules§

align
Pure alignment / distribution math. UI-agnostic: world-space bounds in, world-space deltas out. Callers convert deltas to parent space and author them via resolve_property_edit so Design stays static and Animate keys.
assets
color
Pure HSV <-> RGB conversion and a bounded recent-swatches ring buffer. No UI dependencies.
context_menu
Context-menu models and command builders. Pure.
fill
Helpers for finding and editing the style node that paints a shape.
inspect
Property inspector: descriptors, diamond state, edit commands.
layers
Pure layer-list helpers: tree flatten, drop targets, command builders.
machine
Pure state-machine authoring helpers.
modifiers
Command builders for adding shape modifiers to a group.
path
Helpers for editing animated paths at the correct frame.
stroke
Pure command builders for stroke dash structure.

Structs§

FitState
Fit-state tracker shared by the editor viewport and the player embed: remembers the last fitted surface (+ artboard) and only refits on resize or explicit invalidation, so interactive zoom survives redraws.
Modifiers
Selection
SnapConfig
ToolContext
ViewTransform
Screen ↔ world mapping. Px tolerance in world units.

Functions§

fit_exact_view
Exact-fit shared by presentational embeds: artboard fills surface with no margin, letterboxing inside the surface when aspects differ. No-op on degenerate inputs.
fit_view
Margin-fit shared by the editor viewport and the player embed: artboard inside surface with a 56 px margin, centered. No-op on degenerate inputs.