diff --git a/node-graph/nodes/gcore/src/context.rs b/node-graph/nodes/gcore/src/context.rs index 0357069b37..27b338ff50 100644 --- a/node-graph/nodes/gcore/src/context.rs +++ b/node-graph/nodes/gcore/src/context.rs @@ -149,5 +149,5 @@ fn read_index( ) -> f64 { // The chain's innermost entry is the consuming wire's own lane from the // decompose-and-promote split; the loops the reader counts sit above it. - ctx.try_index().and_then(|mut iter| iter.nth(loop_level as usize + 1).or_else(|| iter.last())).unwrap_or(0) as f64 + ctx.try_index().and_then(|mut iter| iter.nth(loop_level as usize + 1)).unwrap_or(0) as f64 } diff --git a/node-graph/nodes/gcore/src/memo.rs b/node-graph/nodes/gcore/src/memo.rs index 29a5ff5af0..894aa0bef3 100644 --- a/node-graph/nodes/gcore/src/memo.rs +++ b/node-graph/nodes/gcore/src/memo.rs @@ -1,5 +1,5 @@ use core_types::arena::ArenaCell; -use core_types::context::{Ctx, CtxSnapshot, DeriveCtx, ExtractAll, ExtractIndex, InjectIndex}; +use core_types::context::{Ctx, CtxSnapshot, DeriveCtx, ExtractAll, ModifyIndex}; use core_types::frame_table::{FrameTable, Lookup}; use core_types::gpoll::{Finality, GPoll}; use core_types::graphene_hash::CacheHash; @@ -31,7 +31,7 @@ pub struct MemoLevel { /// materialization of the content instead of re-evaluating it per lane. #[node_macro::node(category("General"), path(graphene_core::memo))] fn memoize<'e>( - ctx: impl Ctx + CacheHash + DeriveCtx + ExtractArena<'e> + ExtractIndex + InjectIndex + Copy, + ctx: impl Ctx + CacheHash + DeriveCtx + ExtractArena<'e> + ModifyIndex + Copy, #[data] cache: Arc>>, content: impl Node, Output = RecordValue<'e>>, ) -> GPoll> { @@ -188,7 +188,7 @@ type MonitorValue = Arc>>>; /// The Monitor node is used by the editor to access the data flowing through it. #[node_macro::node(category(""), path(graphene_core::memo), serialize(serialize_monitor), properties("monitor_properties"))] fn monitor<'e>( - ctx: impl Ctx + DeriveCtx + ExtractAll + ExtractArena<'e> + ExtractIndex + InjectIndex + Copy, + ctx: impl Ctx + DeriveCtx + ExtractAll + ExtractArena<'e> + ModifyIndex + Copy, #[data] io: MonitorValue, content: impl Node, Output = RecordValue<'e>>, ) -> GPoll> { diff --git a/node-graph/nodes/gcore/src/record.rs b/node-graph/nodes/gcore/src/record.rs index 1bcd7e847c..d197804ca0 100644 --- a/node-graph/nodes/gcore/src/record.rs +++ b/node-graph/nodes/gcore/src/record.rs @@ -7,7 +7,7 @@ use core_types::Ctx; use core_types::attribute::{Attr, EditorLayerPath, Opacity, RemoveAttr, Transform}; -use core_types::context::{DeriveCtx, ExtractIndex, ExtractIndices, IndexLink, InjectIndex}; +use core_types::context::{DeriveCtx, ExtractIndex, ExtractIndices, IndexLink, InjectIndex, ModifyIndex}; use core_types::extent::{ExtentIn, LevelIn, ListIn, ValueIn}; use core_types::gpoll::{ErrorKind, Extent, GPoll, GraphError, Interrupt, Level}; use core_types::node::Lane; @@ -63,12 +63,12 @@ fn repeat_opacity(ctx: impl Ctx + ExtractIndex, element: f64, count: u32) -> ILi } #[node_macro::node(category("Test"))] -fn sum(_: impl Ctx + ExtractIndex + InjectIndex + Copy, items: IList) -> f64 { +fn sum(_: impl Ctx, items: IList) -> f64 { items.into_iter().sum() } #[node_macro::node(category("Test"))] -fn sum_nested(_: impl Ctx + ExtractIndex + InjectIndex + Copy, items: IList>) -> f64 { +fn sum_nested(_: impl Ctx, items: IList>) -> f64 { items.into_iter().sum() } @@ -196,7 +196,7 @@ fn resolve_index(index: f64, total: u64) -> Option { /// the omitted index read one lane further. An out-of-range index passes the /// level through unchanged. #[node_macro::node(category("Test"), extent(omit_element_extent))] -fn omit_element(ctx: impl Ctx + ExtractIndex + InjectIndex + Copy, content: impl Node, Output = T>, index: f64) -> Result { +fn omit_element(ctx: impl Ctx + ModifyIndex + Copy, content: impl Node, Output = T>, index: f64) -> Result { let total = match content.extent(ctx, Level::Total) { GPoll::Final(Extent::Exactly(count)) => count as u64, GPoll::Pending => return Err(Interrupt::Pending), @@ -225,7 +225,7 @@ fn omit_element_extent(content: ExtentIn<'_>, index: ValueIn<'_, f64>, level: Le /// Rank-model Index Elements: a one-lane level holding the item at the index /// with its attributes, or an empty level when the index is out of range. #[node_macro::node(category("Test"), extent(index_elements_extent))] -fn index_elements(ctx: impl Ctx + ExtractIndex + InjectIndex + Copy, content: impl Node, Output = T>, index: f64) -> Result { +fn index_elements(ctx: impl Ctx + ModifyIndex + Copy, content: impl Node, Output = T>, index: f64) -> Result { let total = match content.extent(ctx, Level::Total) { GPoll::Final(Extent::Exactly(count)) => count as u64, GPoll::Pending => return Err(Interrupt::Pending), diff --git a/node-graph/nodes/graphic/src/artboard.rs b/node-graph/nodes/graphic/src/artboard.rs index ddd5b88990..cf626cad2b 100644 --- a/node-graph/nodes/graphic/src/artboard.rs +++ b/node-graph/nodes/graphic/src/artboard.rs @@ -2,7 +2,7 @@ use core_types::attribute::{Attr, Background, Clip, Dimensions, Location}; use core_types::extent::{ExtentIn, LevelIn, ValueIn}; use core_types::gpoll::{Extent, GPoll, Interrupt}; use core_types::transform::TransformMut; -use core_types::{Color, Ctx, DeriveCtx, ExtractIndex, InjectIndex, ModifyFootprint}; +use core_types::{Color, Ctx, DeriveCtx, ModifyFootprint}; use glam::DVec2; use graphic_types::Artboard; use graphic_types::graphic::Graphic; @@ -22,7 +22,7 @@ fn translate_footprint_extent(content: ExtentIn<'_>, _offset: ValueIn<'_, DVec2> /// Constructs an artboard element with the given content and metadata stored as attributes. #[node_macro::node(category(""))] pub fn create_artboard( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, /// Graphics to include within the artboard. content: IList, /// Coordinate of the top-left corner of the artboard within the document. diff --git a/node-graph/nodes/graphic/src/graphic.rs b/node-graph/nodes/graphic/src/graphic.rs index 61d39ef2db..389fb59ae8 100644 --- a/node-graph/nodes/graphic/src/graphic.rs +++ b/node-graph/nodes/graphic/src/graphic.rs @@ -5,7 +5,7 @@ use core_types::gpoll::{Extent, GPoll, GraphError, Interrupt, Level}; use core_types::list::List; use core_types::registry::types::{Angle, SignedInteger}; use core_types::uuid::NodeId; -use core_types::{ATTR_EDITOR_LAYER_PATH, ATTR_TRANSFORM, CacheHash, Color, Ctx, DeriveCtx, ExtractIndex, InjectIndex}; +use core_types::{ATTR_EDITOR_LAYER_PATH, ATTR_TRANSFORM, CacheHash, Color, Ctx, DeriveCtx, ExtractIndex, InjectIndex, ModifyIndex}; use glam::{DAffine2, DVec2}; use graphic_types::graphic::{Graphic, IntoGraphicList}; use graphic_types::{ATTR_EDITOR_MERGED_LAYERS, Artboard, Vector}; @@ -27,7 +27,7 @@ fn resolve_index(index: f64, total: u64) -> Option { /// attributes, or an empty level when the index is out of range. #[node_macro::node(category("General"), extent(index_elements_extent))] pub fn index_elements( - ctx: impl Ctx + ExtractIndex + InjectIndex + Copy, + ctx: impl Ctx + ModifyIndex + Copy, /// The list of data. list: impl Node, Output = T>, /// The index of the item to retrieve, starting from 0 for the first item. Negative indices count backwards from the end of the list, starting from -1 for the last item. @@ -60,7 +60,7 @@ fn index_elements_extent(list: ExtentIn<'_>, index: ValueIn<'_, f64>, level: Lev /// If no value exists at that index, the list is returned unchanged. #[node_macro::node(category("General"), extent(omit_element_extent))] pub fn omit_element( - ctx: impl Ctx + ExtractIndex + InjectIndex + Copy, + ctx: impl Ctx + ModifyIndex + Copy, /// The list of data. list: impl Node, Output = T>, /// The index of the item to remove, starting from 0 for the first item. Negative indices count backwards from the end of the list, starting from -1 for the last item. @@ -96,7 +96,7 @@ fn omit_element_extent(list: ExtentIn<'_>, index: ValueIn<'_, f64>, level: Level /// If no value exists at that index, the element type's default is returned. #[node_macro::node(category("General"))] pub fn extract_element( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, /// The `List` of data to extract from. #[implementations(String, f64, NodeId, Color, GradientStops, Vector, Raster, Graphic, Artboard)] list: IList, @@ -455,7 +455,7 @@ pub fn legacy_layer_extend( /// The inverse of this node is 'Flatten Graphic'. #[node_macro::node(category("General"), extent(wrap_graphic_extent))] pub fn wrap_graphic( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, #[implementations(Graphic, Vector, Raster, Raster, Color, GradientStops, String)] content: IList, ) -> Result, Interrupt> { // SAFETY: a materialized input's frames are arena-resident. @@ -525,7 +525,7 @@ pub fn to_graphic_element + Clone + Send + Sync + core_types::C /// graphic identifier. #[node_macro::node(category(""), extent(wrap_graphic_extent))] pub fn to_graphic_typed( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, #[implementations(Vector, Raster, Raster, Color, GradientStops, String)] content: IList, ) -> Result, Interrupt> { // SAFETY: a materialized input's frames are arena-resident. @@ -539,7 +539,7 @@ pub fn to_graphic_typed Result, Interrupt> { +pub fn to_graphic_unit(_: impl Ctx, _content: ()) -> Result, Interrupt> { Err(core_types::gpoll::GraphError::past_end().into()) } @@ -553,7 +553,7 @@ fn to_graphic_unit_extent(_content: core_types::extent::ValueIn<'_, ()>, _level: /// the last legacy consumer. #[node_macro::node(category(""))] pub fn level_to_list( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, #[implementations(Graphic, Vector, Raster, Raster, Color, GradientStops, String)] value: IList, _converter: (), ) -> List { @@ -650,7 +650,7 @@ pub fn flatten_gradient(_: impl Ctx, #[implementations(List< /// Constructs a gradient from a `Color[]`, where the colors are evenly distributed as gradient stops across the range from 0 to 1. #[node_macro::node(category("Color"))] -fn colors_to_gradient(_: impl Ctx + ExtractIndex + InjectIndex + Copy, colors: IList) -> GradientStops { +fn colors_to_gradient(_: impl Ctx, colors: IList) -> GradientStops { let stop = |position: f64, color: Color| GradientStop { position, midpoint: 0.5, color }; match colors.len() { 0 => GradientStops::new(vec![stop(0., Color::BLACK), stop(1., Color::BLACK)]), diff --git a/node-graph/nodes/graphic/src/record.rs b/node-graph/nodes/graphic/src/record.rs index 9f10f7f8e9..f56d748285 100644 --- a/node-graph/nodes/graphic/src/record.rs +++ b/node-graph/nodes/graphic/src/record.rs @@ -115,7 +115,7 @@ fn flatten_extent(content: ListIn<'_, Graphic>, fully_flatten: ValueIn<'_, bool> /// Rank-model Wrap: the content level as one group element on a one-lane /// level, the inverse of flatten's one-level descent. #[node_macro::node(category("Test"), extent(wrap_extent))] -fn wrap(_: impl Ctx + ExtractIndex + InjectIndex + Copy, content: IList) -> Result, Interrupt> { +fn wrap(_: impl Ctx, content: IList) -> Result, Interrupt> { // SAFETY: a materialized input's frames are arena-resident. let item = unsafe { core_types::record::GroupItem::from_resident(content.batch()) }; Ok(Graphic::Group(core_types::record::Group { @@ -132,7 +132,7 @@ fn wrap_extent(_content: ListIn<'_, Graphic>, _level: LevelIn) -> GPoll /// Rank-model colors-to-gradient: the color level folds into one gradient /// with evenly spaced stops. #[node_macro::node(category("Test"))] -fn to_gradient(_: impl Ctx + ExtractIndex + InjectIndex + Copy, colors: IList) -> GradientStops { +fn to_gradient(_: impl Ctx, colors: IList) -> GradientStops { let stop = |position: f64, color: Color| GradientStop { position, midpoint: 0.5, color }; match colors.len() { 0 => GradientStops::new(vec![stop(0., Color::BLACK), stop(1., Color::BLACK)]), diff --git a/node-graph/nodes/gstd/src/platform_application_io.rs b/node-graph/nodes/gstd/src/platform_application_io.rs index be200b9433..1a5065e2b6 100644 --- a/node-graph/nodes/gstd/src/platform_application_io.rs +++ b/node-graph/nodes/gstd/src/platform_application_io.rs @@ -14,7 +14,9 @@ use core_types::runtime::SourceFuture; use core_types::transform::Footprint; #[cfg(target_family = "wasm")] use core_types::{ATTR_TRANSFORM, WasmNotSend}; -use core_types::{Color, Ctx, ExtractIndex, InjectIndex}; +use core_types::{Color, Ctx}; +#[cfg(target_family = "wasm")] +use graphic_types::ATTR_EDITOR_MERGED_LAYERS; pub use graph_craft::application_io::resource::{Resource, ResourceHash}; pub use graph_craft::application_io::*; pub use graph_craft::document::value::RenderOutputType; @@ -128,7 +130,7 @@ fn string_to_bytes(_: impl Ctx, string: String) -> Arc<[u8]> { /// Converts extracted raw RGBA pixel data from an input image. Each pixel becomes 4 sequential bytes. Useful for transmission over HTTP or writing to files. #[node_macro::node(category("Web Request"), name("Image to Bytes"))] -fn image_to_bytes(_: impl Ctx + ExtractIndex + InjectIndex + Copy, image: IList>) -> Arc<[u8]> { +fn image_to_bytes(_: impl Ctx, image: IList>) -> Arc<[u8]> { if image.is_empty() { return Arc::from(Vec::new()); } diff --git a/node-graph/nodes/raster/src/gradient_map.rs b/node-graph/nodes/raster/src/gradient_map.rs index 1f9c660e69..0965b677c6 100644 --- a/node-graph/nodes/raster/src/gradient_map.rs +++ b/node-graph/nodes/raster/src/gradient_map.rs @@ -1,7 +1,7 @@ //! Not immediately shader compatible due to needing [`GradientStops`] as a param, which needs [`Vec`] use crate::adjust::Adjust; -use core_types::{Color, Ctx, ExtractIndex, InjectIndex}; +use core_types::{Color, Ctx}; use raster_types::{CPU, Raster}; use vector_types::GradientStops; @@ -10,7 +10,7 @@ use vector_types::GradientStops; // https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#:~:text=Gradient%20settings%20(Photoshop%206.0) #[node_macro::node(category("Raster: Adjustment"))] fn gradient_map + Clone + Send + Sync + core_types::CacheHash + 'static>( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, #[implementations( Raster, Color, diff --git a/node-graph/nodes/raster/src/std_nodes.rs b/node-graph/nodes/raster/src/std_nodes.rs index c7c17f1490..fdf188bac7 100644 --- a/node-graph/nodes/raster/src/std_nodes.rs +++ b/node-graph/nodes/raster/src/std_nodes.rs @@ -229,7 +229,7 @@ fn combine_channels_extent( #[node_macro::node(category("Raster"))] pub fn mask( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, /// The image to be masked. (mut image, lane_transform): (Raster, Attr), /// The stencil to be used for masking. @@ -331,7 +331,7 @@ pub fn empty_image_core(transform: DAffine2, color: Color) -> Raster { } #[node_macro::node(category("Debug"))] -pub fn empty_image(_: impl Ctx + ExtractIndex + InjectIndex + Copy, transform: DAffine2, color: IList) -> (Raster, Attr) { +pub fn empty_image(_: impl Ctx, transform: DAffine2, color: IList) -> (Raster, Attr) { let color = match color.len() { 0 => Color::WHITE, _ => color.get(0), diff --git a/node-graph/nodes/transform/src/transform_nodes.rs b/node-graph/nodes/transform/src/transform_nodes.rs index 9054cedc50..a113de0b5d 100644 --- a/node-graph/nodes/transform/src/transform_nodes.rs +++ b/node-graph/nodes/transform/src/transform_nodes.rs @@ -4,7 +4,7 @@ use core_types::color::Color; use core_types::extent::{ExtentIn, LevelIn, ValueIn}; use core_types::gpoll::{Extent, GPoll, Interrupt}; use core_types::transform::{ApplyTransform, ScaleType, Transform}; -use core_types::{CacheHash, Context, Ctx, DeriveCtx, ExtractIndex, InjectFootprint, InjectIndex, ModifyFootprint}; +use core_types::{CacheHash, Context, Ctx, DeriveCtx, InjectFootprint, ModifyFootprint}; use glam::{DAffine2, DMat2, DVec2}; use graphic_types::Graphic; use graphic_types::Vector; @@ -98,7 +98,7 @@ fn replace_transform(_: impl Ctx + InjectFootprint, (element, _content_transf /// Obtains the transform of the first lane of the input wire, if present. #[node_macro::node(category("Math: Transform"), path(core_types::vector))] fn extract_transform( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, #[implementations(Graphic, Vector, Raster, Raster, Color, GradientStops)] content: IList, ) -> DAffine2 { match content.len() { diff --git a/node-graph/nodes/vector/src/generator_nodes.rs b/node-graph/nodes/vector/src/generator_nodes.rs index ef6216face..0e80ed6ce1 100644 --- a/node-graph/nodes/vector/src/generator_nodes.rs +++ b/node-graph/nodes/vector/src/generator_nodes.rs @@ -1,5 +1,5 @@ use core_types::registry::types::{Angle, PixelLength, PixelSize}; -use core_types::{CacheHash, Ctx, ExtractIndex, InjectIndex}; +use core_types::{CacheHash, Ctx}; use dyn_any::DynAny; use glam::DVec2; use graphic_types::Vector; @@ -135,7 +135,7 @@ fn ellipse( /// Generates a rectangle shape with the chosen width and height. It may also have rounded corners if desired. #[node_macro::node(category("Vector: Shape"), properties("rectangle_properties"))] fn rectangle( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, _primary: (), #[unit(" px")] #[default(100)] diff --git a/node-graph/nodes/vector/src/vector_nodes.rs b/node-graph/nodes/vector/src/vector_nodes.rs index 2cd89b0f18..4f0aeea893 100644 --- a/node-graph/nodes/vector/src/vector_nodes.rs +++ b/node-graph/nodes/vector/src/vector_nodes.rs @@ -924,7 +924,7 @@ fn extrude(_: impl Ctx, mut source: Vector, direction: DVec2, joining_algorithm: } #[node_macro::node(category("Vector: Modifier"), path(core_types::vector))] -fn box_warp(_: impl Ctx + ExtractIndex + InjectIndex + Copy, (vector, transform): (Vector, Attr), #[expose] rectangle: IList) -> (Vector, Attr) { +fn box_warp(_: impl Ctx, (vector, transform): (Vector, Attr), #[expose] rectangle: IList) -> (Vector, Attr) { if rectangle.is_empty() { return (vector, Attr(*transform)); } @@ -1283,7 +1283,7 @@ fn bounding_box(_: impl Ctx, vector: Vector) -> Vector { } #[node_macro::node(category("Vector: Measure"), path(core_types::vector))] -fn dimensions(_: impl Ctx + ExtractIndex + InjectIndex + Copy, content: IList) -> DVec2 { +fn dimensions(_: impl Ctx, content: IList) -> DVec2 { (0..content.len()) .filter_map(|index| content.element_ref(index).bounding_box_with_transform(content.lane(index).attr::())) .reduce(|[acc_top_left, acc_bottom_right], [top_left, bottom_right]| [acc_top_left.min(top_left), acc_bottom_right.max(bottom_right)]) @@ -1704,7 +1704,7 @@ fn separate_subpaths_extent(content: ListIn<'_, Vector>, level: LevelIn) -> GPol /// Determines if the subpath at the given index (across all vector element subpaths) is closed, meaning its ends are connected together forming a loop. #[node_macro::node(name("Path is Closed"), category("Vector: Measure"), path(core_types::vector))] fn path_is_closed( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, /// The vector content whose subpaths are inspected. content: IList, /// The index of the subpath to check, counting across subpaths in all vector elements. @@ -2274,7 +2274,7 @@ fn cut_segments(_: impl Ctx, mut content: Vector) -> Vector { /// If multiple subpaths make up the path, the whole number part of the progression value selects the subpath and the decimal part determines the position along it. #[node_macro::node(name("Position on Path"), category("Vector: Measure"), path(graphene_core::vector))] fn position_on_path( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, /// The path to traverse. content: IList, /// The factor from the start to the end of the path, 0–1 for one subpath, 1–2 for a second subpath, and so on. @@ -2312,7 +2312,7 @@ fn position_on_path( /// If multiple subpaths make up the path, the whole number part of the progression value selects the subpath and the decimal part determines the position along it. #[node_macro::node(name("Tangent on Path"), category("Vector: Measure"), path(graphene_core::vector))] fn tangent_on_path( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, /// The path to traverse. content: IList, /// The factor from the start to the end of the path, 0–1 for one subpath, 1–2 for a second subpath, and so on. @@ -3584,7 +3584,7 @@ fn close_path(_: impl Ctx, mut source: Vector) -> Vector { } #[node_macro::node(category("Vector: Measure"), path(core_types::vector))] -fn point_inside(_: impl Ctx + ExtractIndex + InjectIndex + Copy, source: IList, point: DVec2) -> bool { +fn point_inside(_: impl Ctx, source: IList, point: DVec2) -> bool { (0..source.len()).any(|index| { let transform: DAffine2 = source.lane(index).attr::(); source.element_ref(index).check_point_inside_shape(transform, point) @@ -3595,14 +3595,14 @@ fn point_inside(_: impl Ctx + ExtractIndex + InjectIndex + Copy, source: IList( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, #[implementations(Graphic, Artboard, Vector, Raster, Color, GradientStops, String)] content: IList, ) -> f64 { content.len() as f64 } #[node_macro::node(category("Vector: Measure"), path(graphene_core::vector))] -fn count_points(_: impl Ctx + ExtractIndex + InjectIndex + Copy, content: IList) -> f64 { +fn count_points(_: impl Ctx, content: IList) -> f64 { (0..content.len()).map(|index| content.element_ref(index).point_domain.positions().len() as f64).sum() } @@ -3610,7 +3610,7 @@ fn count_points(_: impl Ctx + ExtractIndex + InjectIndex + Copy, content: IList< /// If no value exists at that index, the position (0, 0) is returned. #[node_macro::node(category("Vector: Measure"), path(graphene_core::vector))] fn index_points( - _: impl Ctx + ExtractIndex + InjectIndex + Copy, + _: impl Ctx, /// The vector element or elements containing the anchor points to be retrieved. content: IList, /// The index of the points to retrieve, starting from 0 for the first point. Negative indices count backwards from the end, starting from -1 for the last item. @@ -3644,7 +3644,7 @@ fn index_points( } #[node_macro::node(category("Vector: Measure"), path(core_types::vector))] -fn path_length(_: impl Ctx + ExtractIndex + InjectIndex + Copy, source: IList) -> f64 { +fn path_length(_: impl Ctx, source: IList) -> f64 { (0..source.len()) .map(|index| { let transform: DAffine2 = source.lane(index).attr::(); @@ -3664,7 +3664,7 @@ fn path_length(_: impl Ctx + ExtractIndex + InjectIndex + Copy, source: IList) -> Result { +fn area(_: impl Ctx, vector: IList) -> Result { Ok((0..vector.len()) .map(|index| { let transform: DAffine2 = vector.lane(index).attr::(); @@ -3676,7 +3676,7 @@ fn area(_: impl Ctx + ExtractIndex + InjectIndex + Copy, vector: IList) #[node_macro::node(category("Vector: Measure"), path(core_types::vector))] // The footprint reset moved to the nullification pass, as in `area`. -fn centroid(_: impl Ctx + ExtractIndex + InjectIndex + Copy, vector: IList, centroid_type: CentroidType) -> Result { +fn centroid(_: impl Ctx, vector: IList, centroid_type: CentroidType) -> Result { if vector.is_empty() { return Ok(DVec2::ZERO); }