Skip to content

feat: wrap layer children in Placed for inline placement#5

Merged
AsPulse merged 1 commit into
mainfrom
feat/placed-component-wrapper
May 24, 2026
Merged

feat: wrap layer children in Placed for inline placement#5
AsPulse merged 1 commit into
mainfrom
feat/placed-component-wrapper

Conversation

@AsPulse
Copy link
Copy Markdown
Member

@AsPulse AsPulse commented May 24, 2026

Replace the (Vec2, Box<dyn _>) tuple in layer children with a Placed<C> wrapper, and add ext traits so positioning becomes a method chain on the component itself. Layer construction can now be a single struct-literal expression with all children placed inline.

  • tellur-core::placement (new): Placed<C: ?Sized> { position, child }, plus VectorPlacement / RasterPlacement ext traits providing at(pos) and anchored(self_anchor).snap_to(target_point). The anchored form mirrors Vec2::anchored(...).snap_to(...) so the geometry vocabulary carries over to component placement.
  • tellur-core::layer: VectorLayer.children / Layer.children now hold Vec<Placed<dyn _>>; add takes a single Placed<dyn _> argument.
  • tellur-core::geometry: rename Vec2::anchoranchored (past-participle reads better at call sites). Drop AnchoredSize::snap_to_anchor — callers use snap_to(target_anchor.point(target_size)).
  • Examples: all three reshaped to construct the layer as a single struct-literal with inline placement; timeline_to_mp4 also unrolls the fps loop into four direct entries. The (view_box().anchor().snap_to_anchor(...), boxed()) tuple form is gone.

@AsPulse AsPulse merged commit 23b003b into main May 24, 2026
14 checks passed
@AsPulse AsPulse deleted the feat/placed-component-wrapper branch May 25, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant