Skip to content
Open
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
64 changes: 62 additions & 2 deletions node-graph/nodes/graphic/src/graphic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ pub fn index_elements<T: graphic_types::graphic::AtIndex + Clone + Default>(
List<String>,
List<f64>,
List<u8>,
List<bool>,
List<NodeId>,
List<DAffine2>,
List<BlendMode>,
List<GradientType>,
List<GradientSpreadMethod>,
)]
list: 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.
Expand Down Expand Up @@ -81,13 +86,18 @@ pub fn extract_element<T: Clone + Default + Send + Sync + 'static>(
List<String>,
List<f64>,
List<u8>,
List<bool>,
List<NodeId>,
List<Color>,
List<GradientStops>,
List<Vector>,
List<Raster<CPU>>,
List<Graphic>,
List<Artboard>,
List<DAffine2>,
List<BlendMode>,
List<GradientType>,
List<GradientSpreadMethod>,
)]
list: List<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.
Expand Down Expand Up @@ -116,6 +126,14 @@ async fn map<Item: AnyHash + Send + Sync + CacheHash>(
List<Raster<CPU>>,
List<Color>,
List<GradientStops>,
List<String>,
List<f64>,
List<u8>,
List<bool>,
List<DAffine2>,
List<BlendMode>,
List<GradientType>,
List<GradientSpreadMethod>,
)]
content: List<Item>,
#[implementations(
Expand All @@ -124,6 +142,14 @@ async fn map<Item: AnyHash + Send + Sync + CacheHash>(
Context -> List<Raster<CPU>>,
Context -> List<Color>,
Context -> List<GradientStops>,
Context -> List<String>,
Context -> List<f64>,
Context -> List<u8>,
Context -> List<bool>,
Context -> List<DAffine2>,
Context -> List<BlendMode>,
Context -> List<GradientType>,
Context -> List<GradientSpreadMethod>,
)]
mapped: impl Node<Context<'static>, Output = List<Item>>,
) -> List<Item> {
Expand Down Expand Up @@ -495,11 +521,45 @@ fn read_attribute_raster(
pub async fn extend<T: 'n + Send + Clone>(
_: impl Ctx,
/// The `List` whose items will appear at the start of the extended `List`.
#[implementations(List<Artboard>, List<Graphic>, List<Vector>, List<Raster<CPU>>, List<Raster<GPU>>, List<Color>, List<GradientStops>)]
#[implementations(
List<Artboard>,
List<Graphic>,
List<Vector>,
List<Raster<CPU>>,
List<Raster<GPU>>,
List<Color>,
List<GradientStops>,
List<String>,
List<f64>,
List<u8>,
List<bool>,
List<NodeId>,
List<DAffine2>,
List<BlendMode>,
List<GradientType>,
List<GradientSpreadMethod>,
)]
base: List<T>,
/// The `List` whose items will appear at the end of the extended `List`.
#[expose]
#[implementations(List<Artboard>, List<Graphic>, List<Vector>, List<Raster<CPU>>, List<Raster<GPU>>, List<Color>, List<GradientStops>)]
#[implementations(
List<Artboard>,
List<Graphic>,
List<Vector>,
List<Raster<CPU>>,
List<Raster<GPU>>,
List<Color>,
List<GradientStops>,
List<String>,
List<f64>,
List<u8>,
List<bool>,
List<NodeId>,
List<DAffine2>,
List<BlendMode>,
List<GradientType>,
List<GradientSpreadMethod>,
)]
new: List<T>,
) -> List<T> {
let mut base = base;
Expand Down