Skip to content

feat: adopt constraint-based layout protocol with paint_bounds#7

Merged
AsPulse merged 2 commits into
mainfrom
feat/render-within-stretch
May 24, 2026
Merged

feat: adopt constraint-based layout protocol with paint_bounds#7
AsPulse merged 2 commits into
mainfrom
feat/render-within-stretch

Conversation

@AsPulse
Copy link
Copy Markdown
Member

@AsPulse AsPulse commented May 24, 2026

Switch the component pipeline to a Flutter / SwiftUI-style constraint-based layout protocol, and add the painting primitives needed for effects to work inside layout containers. PR #6's BouncingDot still took scene_width; that's gone.

  • Trait surface: view_box()layout(Constraints) -> Vec2 + paint_bounds(size) -> Rect + render(size [, target]). Constraints { min, max } with tight / loose / tighten_cross lives in tellur-core::geometry alongside Axis.
  • Layout containers: SizeMode { Fill, Hug, Fixed(f32) }; Sized / Place / Frame replace Align; CrossAlign::Stretch propagates a tight cross-axis constraint so children fill the stack.
  • paint_bounds propagation: raster containers union the child's paint rect into their own. DecoratedBox keeps the default and acts as a natural clip boundary. composite_children takes paint_rect: Rect.
  • #[available] attribute on a fn argument lets a component opt in to the parent-assigned size at render time.
  • tellur-renderer::shadow (new): DropShadow with a 3-pass box blur; paint_bounds and padding both expand by 3 * radius.
  • Examples migrated. BouncingDot drops scene_width and wraps the circle in a DropShadow.

@AsPulse AsPulse merged commit 9497725 into main May 24, 2026
14 checks passed
@AsPulse AsPulse deleted the feat/render-within-stretch 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