mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 09:18:11 +08:00
Instance tables refactor part 4: replace ArtboardGroups with multi-row Instances<Artboard> (#2265)
* Clean up dyn_any usages * Migrate ArtboardGroup to ArtboardGroupTable (not yet flattened) * Reorder graphical data imports * Flatten and remove ArtboardGroup in favor of ArtboardGroupTable * Fix test
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
use crate::transform::Footprint;
|
||||
use crate::{NodeIO, NodeIOTypes, Type};
|
||||
use crate::{Node, NodeIO, NodeIOTypes, Type, WasmNotSend};
|
||||
|
||||
use dyn_any::DynAny;
|
||||
use dyn_any::{DynAny, StaticType};
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::Deref;
|
||||
use std::pin::Pin;
|
||||
use std::sync::{LazyLock, Mutex};
|
||||
@@ -153,11 +154,6 @@ impl NodeContainer {
|
||||
}
|
||||
}
|
||||
|
||||
use crate::Node;
|
||||
use crate::WasmNotSend;
|
||||
use dyn_any::StaticType;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
/// Boxes the input and downcasts the output.
|
||||
/// Wraps around a node taking Box<dyn DynAny> and returning Box<dyn DynAny>
|
||||
#[derive(Clone)]
|
||||
@@ -166,7 +162,11 @@ pub struct DowncastBothNode<I, O> {
|
||||
_i: PhantomData<I>,
|
||||
_o: PhantomData<O>,
|
||||
}
|
||||
impl<'input, O: 'input + StaticType + WasmNotSend, I: 'input + StaticType + WasmNotSend> Node<'input, I> for DowncastBothNode<I, O> {
|
||||
impl<'input, O, I> Node<'input, I> for DowncastBothNode<I, O>
|
||||
where
|
||||
O: 'input + StaticType + WasmNotSend,
|
||||
I: 'input + StaticType + WasmNotSend,
|
||||
{
|
||||
type Output = DynFuture<'input, O>;
|
||||
#[inline]
|
||||
fn eval(&'input self, input: I) -> Self::Output {
|
||||
@@ -234,9 +234,11 @@ pub struct DynAnyNode<I, O, Node> {
|
||||
_o: PhantomData<O>,
|
||||
}
|
||||
|
||||
impl<'input, _I: 'input + StaticType + WasmNotSend, _O: 'input + StaticType + WasmNotSend, N: 'input> Node<'input, Any<'input>> for DynAnyNode<_I, _O, N>
|
||||
impl<'input, _I, _O, N> Node<'input, Any<'input>> for DynAnyNode<_I, _O, N>
|
||||
where
|
||||
N: Node<'input, _I, Output = DynFuture<'input, _O>>,
|
||||
_I: 'input + dyn_any::StaticType + WasmNotSend,
|
||||
_O: 'input + dyn_any::StaticType + WasmNotSend,
|
||||
N: 'input + Node<'input, _I, Output = DynFuture<'input, _O>>,
|
||||
{
|
||||
type Output = FutureAny<'input>;
|
||||
#[inline]
|
||||
@@ -275,9 +277,11 @@ where
|
||||
self.node.serialize()
|
||||
}
|
||||
}
|
||||
impl<'input, _I: 'input + StaticType, _O: 'input + StaticType, N: 'input> DynAnyNode<_I, _O, N>
|
||||
impl<'input, _I, _O, N> DynAnyNode<_I, _O, N>
|
||||
where
|
||||
N: Node<'input, _I, Output = DynFuture<'input, _O>>,
|
||||
_I: 'input + dyn_any::StaticType,
|
||||
_O: 'input + dyn_any::StaticType,
|
||||
N: 'input + Node<'input, _I, Output = DynFuture<'input, _O>>,
|
||||
{
|
||||
pub const fn new(node: N) -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user