Run cargo fmt

This commit is contained in:
Dennis Kobert
2026-08-29 18:40:02 +00:00
parent 97bc10e4c3
commit a955d6b458
16 changed files with 164 additions and 111 deletions
+35 -7
View File
@@ -691,7 +691,11 @@ mod tests {
let leveled = repeat_opacity_layout(&base);
let frames = frames_for(&[&base, &leveled]);
let node = install(RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(8u32), &base), repeat_opacity_layout_meta(), &[Some(&base)]);
let node = install(
RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(8u32), &base),
repeat_opacity_layout_meta(),
&[Some(&base)],
);
assert_eq!(Node::<ContextImpl>::layout(&node), &leveled);
let GPoll::Final(served) = core_types::record::capture(&node, &indexed, &frames) else {
panic!("expected a final record");
@@ -710,7 +714,11 @@ mod tests {
let base = f64_layout(&[]);
let frames = frames_for(&[&base]);
let node = install(RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(3u32), &base), repeat_opacity_layout_meta(), &[Some(&base)]);
let node = install(
RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(3u32), &base),
repeat_opacity_layout_meta(),
&[Some(&base)],
);
// The pushed level (0, the only level) reports the copy count.
assert_eq!(node.extent_at(&ctx, 0, &frames), core_types::gpoll::GPoll::Final(core_types::gpoll::Extent::Exactly(3)));
}
@@ -852,7 +860,11 @@ mod tests {
let (reverse_edge, reverse_layout) = lifted_value(false);
let frames = frames_for(&[&base, &leveled_content, &count_layout, &reverse_layout]);
let content = install(RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(3u32), &base), repeat_opacity_layout_meta(), &[Some(&base)]);
let content = install(
RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(3u32), &base),
repeat_opacity_layout_meta(),
&[Some(&base)],
);
let meta = core_types::record::LayoutMeta {
sources: vec![0],
reads: vec![],
@@ -1434,7 +1446,11 @@ mod tests {
.map(|&(element, x)| (element, DAffine2::from_translation(glam::DVec2::new(x, 0.))))
.collect(),
};
let node = install(MirrorNode::new(RecordSource::new(content, &layout, &layout), ValueSource::new(true)), mirror_layout_meta(), &[Some(&layout)]);
let node = install(
MirrorNode::new(RecordSource::new(content, &layout, &layout), ValueSource::new(true)),
mirror_layout_meta(),
&[Some(&layout)],
);
let out = Node::<ContextImpl>::layout(&node).clone();
let head = ctx.index_head();
let scoped = ctx.promoted(&head, 0);
@@ -1612,7 +1628,11 @@ mod tests {
let out = f64_layout(&[]);
let frames = frames_for(&[&base, &leveled_content, &count_layout, &reverse_layout, &out]);
let content = install(RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(3u32), &base), repeat_opacity_layout_meta(), &[Some(&base)]);
let content = install(
RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(3u32), &base),
repeat_opacity_layout_meta(),
&[Some(&base)],
);
let meta = core_types::record::LayoutMeta {
sources: vec![0],
reads: vec![],
@@ -1821,7 +1841,11 @@ mod tests {
let out = f64_layout(&[]);
let frames = frames_for(&[&base, &leveled, &out]);
let repeat = install(RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(3u32), &base), repeat_opacity_layout_meta(), &[Some(&base)]);
let repeat = install(
RepeatOpacityNode::new(bare_source(&base, 7.), ValueSource::new(3u32), &base),
repeat_opacity_layout_meta(),
&[Some(&base)],
);
let node = install_flip(SumNode::new(repeat, &leveled), &out);
assert_eq!(Node::<ContextImpl>::layout(&node).depth, 0, "the reducer collapsed the rank level");
@@ -2066,7 +2090,11 @@ mod tests {
let layout = source_opacity_layout();
let frames = frames_for(&[&layout]);
let node = install(SourceOpacityNode::new(ValueSource::new(()), ValueSource::new(3.), ValueSource::new(0.25)), source_opacity_layout_meta(), &[]);
let node = install(
SourceOpacityNode::new(ValueSource::new(()), ValueSource::new(3.), ValueSource::new(0.25)),
source_opacity_layout_meta(),
&[],
);
assert_eq!(Node::<ContextImpl>::layout(&node), &layout);
let GPoll::Final(served) = core_types::record::capture(&node, &ctx, &frames) else {
panic!("expected a final record");
+1 -4
View File
@@ -36,10 +36,7 @@ pub fn create_artboard<'e>(
clip: bool,
) -> (Artboard<'e>, Attr<Location>, Attr<Dimensions>, Attr<Background>, Attr<Clip>) {
let item = content.as_group_item();
let content = core_types::list::List::new_from_element(Graphic::Group(core_types::record::Group {
row: None,
content: item,
}));
let content = core_types::list::List::new_from_element(Graphic::Group(core_types::record::Group { row: None, content: item }));
// Normalize so `location` is the top-left corner and `dimensions` are positive (allowing negative input
// dimensions to represent dragging from the opposite corner). Compute the corner using the raw signed
+2 -8
View File
@@ -461,10 +461,7 @@ pub fn wrap_graphic<'e, T: Clone + Send + Sync + core_types::CacheHash + 'static
#[implementations(Graphic, Vector, Raster<CPU>, Raster<GPU>, Color, GradientStops, String)] content: IList<T>,
) -> Result<IList<Graphic<'e>>, Interrupt> {
let item = content.as_group_item();
Ok(Graphic::Group(core_types::record::Group {
row: None,
content: item,
}))
Ok(Graphic::Group(core_types::record::Group { row: None, content: item }))
}
/// The collected group is the level's single lane.
@@ -530,10 +527,7 @@ pub fn to_graphic_typed<'e, T: Clone + Send + Sync + core_types::CacheHash + 'st
#[implementations(Vector, Raster<CPU>, Raster<GPU>, Color, GradientStops, String)] content: IList<T>,
) -> Result<IList<Graphic<'e>>, Interrupt> {
let item = content.as_group_item();
Ok(Graphic::Group(core_types::record::Group {
row: None,
content: item,
}))
Ok(Graphic::Group(core_types::record::Group { row: None, content: item }))
}
/// An unconnected content input carries the unit, which renders as nothing like
+1 -4
View File
@@ -103,10 +103,7 @@ fn flatten_extent(content: ListIn<'_, Graphic>, fully_flatten: ValueIn<'_, bool>
#[node_macro::node(category("Test"), extent(wrap_extent))]
fn wrap<'e>(_: impl Ctx, content: IList<Graphic<'e>>) -> Result<IList<Graphic<'e>>, Interrupt> {
let item = content.as_group_item();
Ok(Graphic::Group(core_types::record::Group {
row: None,
content: item,
}))
Ok(Graphic::Group(core_types::record::Group { row: None, content: item }))
}
/// The collected group is the level's single lane.
+7 -8
View File
@@ -4,9 +4,9 @@ use core_types::uuid::NodeId;
use core_types::{ATTR_BLEND_MODE, ATTR_CLIPPING_MASK, ATTR_EDITOR_LAYER_PATH, ATTR_OPACITY, ATTR_OPACITY_FILL, ATTR_TRANSFORM, BlendMode, Color, Ctx};
use glam::{DAffine2, DVec2};
use graphic_types::graphic::{GraphicLevel, PaintColumns, PaintReach, bake_paint_transforms, is_paint_present, set_paint_attribute, set_paint_attribute_at};
use graphic_types::markers::{EditorMergedLayers, Fill, Stroke};
use graphic_types::raster_types::{CPU, GPU, Raster};
use graphic_types::vector_types::GradientStops;
use graphic_types::markers::{EditorMergedLayers, Fill, Stroke};
use graphic_types::vector_types::gradient::{GradientSpreadMethod, GradientType};
use graphic_types::vector_types::subpath::{ManipulatorGroup, Subpath};
use graphic_types::vector_types::vector::PointId;
@@ -128,9 +128,7 @@ fn boolean_operation<'e>(
> {
let item = content.as_group_item();
let flattened = flatten_vector_run(GraphicLevel::Run(&item), DAffine2::IDENTITY, PaintReach::NONE);
let snapshot = graphic_types::graphic::run_to_list::<Graphic>(&item)
.expect("the run holds the row's element type")
.into_graphic_list();
let snapshot = graphic_types::graphic::run_to_list::<Graphic>(&item).expect("the run holds the row's element type").into_graphic_list();
boolean_core(ctx.arena(), flattened, snapshot, operation)
}
@@ -157,9 +155,7 @@ fn boolean_operation_vector<'e>(
> {
let item = content.as_group_item();
let flattened = graphic_types::graphic::run_to_list::<Vector>(&item).expect("the run holds vector lanes");
let snapshot = graphic_types::graphic::run_to_list::<Vector>(&item)
.expect("the run holds the row's element type")
.into_graphic_list();
let snapshot = graphic_types::graphic::run_to_list::<Vector>(&item).expect("the run holds the row's element type").into_graphic_list();
boolean_core(ctx.arena(), flattened, snapshot, operation)
}
@@ -445,7 +441,10 @@ fn flatten_group(out: &mut List<Vector>, group: &core_types::record::Group, comp
} else if let Some(image) = graphic_types::graphic::run_to_list::<Raster<GPU>>(item) {
push_rows(out, raster_stand_in_rows(&image, composed));
} else if let Some(color) = graphic_types::graphic::run_to_list::<Color>(item) {
push_rows(out, (0..color.len()).filter_map(|i| Some(color_paint_row(*color.element(i)?, color.clone_item_attributes(i)))).collect());
push_rows(
out,
(0..color.len()).filter_map(|i| Some(color_paint_row(*color.element(i)?, color.clone_item_attributes(i)))).collect(),
);
} else if let Some(gradient) = graphic_types::graphic::run_to_list::<GradientStops>(item) {
push_rows(
out,
+7 -1
View File
@@ -360,7 +360,13 @@ mod test {
transform: local,
};
let mut node = RepeatRadialNode::new(RecordSource::new(content, &layout, &layout), ValueSource::new(90.0f64), ValueSource::new(2.0f64), ValueSource::new(4u32), &layout);
let mut node = RepeatRadialNode::new(
RecordSource::new(content, &layout, &layout),
ValueSource::new(90.0f64),
ValueSource::new(2.0f64),
ValueSource::new(4u32),
&layout,
);
Node::<ContextImpl>::set_layout(&mut node, repeat_radial_layout_meta().resolve(&[Some(&layout)]));
assert_eq!(node.extent_at(&ctx, 0, &frames.reborrow()), GPoll::Final(Extent::Exactly(4)));
+6 -1
View File
@@ -1660,7 +1660,12 @@ fn solidify_stroke_vector<'e>(
Interrupt,
> {
let wrapper = wrap_vector_level(content);
solidify_native_lane(ctx.arena(), graphic_types::graphic::GraphicLevel::Legacy(&wrapper), || legacy_graphic_list_of(content), ctx.index() as usize)
solidify_native_lane(
ctx.arena(),
graphic_types::graphic::GraphicLevel::Legacy(&wrapper),
|| legacy_graphic_list_of(content),
ctx.index() as usize,
)
}
fn solidify_stroke_vector_extent(content: ListIn<'_, Vector>, level: LevelIn) -> GPoll<Extent> {