Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,7 @@ Transparency is supported with `--transparent` for PNG sequences, WebM (VP9), an
- **JSON Schema:** schemars (auto-generated from Rust types)
- **Parallelism:** rayon (multi-threaded frame rendering)

rustmotion ships 60 components, each implementing the `Painter` trait, through a CSS-inspired **box_tree → layout_pass → paint_pass** pipeline:
rustmotion ships 61 components, each implementing the `Painter` trait, through a CSS-inspired **box_tree → layout_pass → paint_pass** pipeline:

1. **box_tree** — builds a tree of `BoxNode { css: CssStyle, children, intrinsic }` from the resolved JSON components
2. **layout_pass** — runs [taffy](https://github.com/DioxusLabs/taffy) to compute each node's `BoxLayout { x, y, width, height }`; leaves that carry an `IntrinsicMeasure` (text, images, codeblocks, ...) are measured through a `measure_fn`
Expand Down
2 changes: 1 addition & 1 deletion crates/rustmotion-components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rustmotion-components"
version.workspace = true
edition = "2021"
description = "Component library for rustmotion (60 components)"
description = "Component library for rustmotion (61 components)"
license = "MIT"
repository = "https://github.com/LeadcodeDev/rustmotion"
readme = "../../README.md"
Expand Down
10 changes: 10 additions & 0 deletions crates/rustmotion-components/src/box_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,14 @@ fn apply_intrinsic_overrides(component: &Component, css: &mut CssStyle) {
css.height = Some(CSize::Length(CLP::String("100%".into())));
}
}
Emitter(_) => {
if css.width.is_none() {
css.width = Some(CSize::Length(CLP::String("100%".into())));
}
if css.height.is_none() {
css.height = Some(CSize::Length(CLP::String("100%".into())));
}
}
Switch(c) => {
if css.width.is_none() {
css.width = Some(CSize::Length(CLP::Px(c.width)));
Expand Down Expand Up @@ -1805,6 +1813,7 @@ fn component_style(c: &Component) -> &CssStyle {
Countdown(c) => &c.style,
Divider(c) => &c.style,
DotMap(c) => &c.style,
Emitter(c) => &c.style,
Gauge(c) => &c.style,
GradientText(c) => &c.style,
Heatmap(c) => &c.style,
Expand Down Expand Up @@ -1864,6 +1873,7 @@ pub fn component_kind(c: &Component) -> &'static str {
Countdown(_) => "countdown",
Divider(_) => "divider",
DotMap(_) => "dot_map",
Emitter(_) => "emitter",
Gauge(_) => "gauge",
GradientText(_) => "gradient_text",
Heatmap(_) => "heatmap",
Expand Down
Loading
Loading