Skip to main content

Module paint_pass

Module paint_pass 

Source
Expand description

Paint pass — walks the BoxTree post-layout and paints each node.

Order per node (top-down):

  1. canvas.save()
  2. apply transform (CSS transform → Skia matrix)
  3. open opacity layer if opacity < 1.0
  4. clip to padding-box if overflow != visible
  5. paint outset box-shadow
  6. paint background
  7. paint border (border-radius aware)
  8. delegate component-specific paint via PaintDispatcher
  9. recurse children sorted by z-index
  10. canvas.restore()

The dispatcher hook lets the higher-level crate plug component-specific paint without coupling rustmotion-core to all 51 component types.

Structs§

EnrichedHit
A hit enriched with a component kind label, ready for the studio overlay. node_id is stable within a single rendered frame.
HitNode
One clickable node: its layout id and on-screen bounding box.
HitRect
Axis-aligned bounding box of a painted node, in device (video-pixel) coords.
NoopDispatcher
No-op dispatcher (useful for tests where only generic box decoration is exercised).
PaintFrame
Frame-level paint context (timing + viewport).
PlaneCamera
Scene camera resolved at a fixed time, ready for per-plane application.

Traits§

PaintDispatcher
Hook to delegate component-specific painting. Implemented by the higher-level crate that owns the actual Component enum.

Functions§

paint_tree
Paint a fully-laid-out box tree onto a Skia canvas.
paint_tree_with_hits
Like paint_tree but also returns the per-frame hit-map: the on-screen bounding box of every component-backed node, in paint order. Used by the studio for click-to-select; the video render path uses paint_tree.
parse_color

Type Aliases§

HitMap
Hit-test map for a single painted frame, in paint order (so later entries are visually on top).