mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 02:38:13 +08:00
Implement the Brush tool (#1099)
* Implement Brush Node * Add color Input * Add VectorPointsNode * Add Erase Node * Adapt compilation infrastructure to allow non Image Frame inputs * Remove debug output from TransformNode * Fix transform calculation * Fix Blending by making the brush texture use associated alpha * Code improvements and UX polish * Rename Opacity to Flow * Add erase option to brush node + fix freehand tool * Fix crash * Revert erase implementation * Fix flattening id calculation * Fix some transformation issues * Fix changing the pivot location * Fix vector data modify bounds * Minor fn name cleanup * Fix some tests * Fix tests --------- Co-authored-by: Keavon Chambers <keavon@keavon.com> Co-authored-by: hypercube <0hypercube@gmail.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
hypercube
parent
758f757775
commit
589ff9a2d3
@@ -1,4 +1,5 @@
|
||||
use core::marker::PhantomData;
|
||||
use dyn_any::{DynAny, StaticType, StaticTypeSized};
|
||||
|
||||
use crate::Node;
|
||||
|
||||
@@ -15,6 +16,10 @@ impl<'i, const N: u32> Node<'i, ()> for IntNode<N> {
|
||||
#[derive(Default, Debug)]
|
||||
pub struct ValueNode<T>(pub T);
|
||||
|
||||
impl<T: StaticTypeSized> StaticType for ValueNode<T> {
|
||||
type Static = ValueNode<T::Static>;
|
||||
}
|
||||
|
||||
impl<'i, T: 'i> Node<'i, ()> for ValueNode<T> {
|
||||
type Output = &'i T;
|
||||
fn eval<'s: 'i>(&'s self, _input: ()) -> Self::Output {
|
||||
@@ -43,6 +48,13 @@ impl<T: Clone + Copy> Copy for ValueNode<T> {}
|
||||
#[derive(Clone)]
|
||||
pub struct ClonedNode<T: Clone>(pub T);
|
||||
|
||||
impl<T: Clone + StaticTypeSized> StaticType for ClonedNode<T>
|
||||
where
|
||||
T::Static: Clone,
|
||||
{
|
||||
type Static = ClonedNode<T::Static>;
|
||||
}
|
||||
|
||||
impl<'i, T: Clone + 'i> Node<'i, ()> for ClonedNode<T> {
|
||||
type Output = T;
|
||||
fn eval<'s: 'i>(&'s self, _input: ()) -> Self::Output {
|
||||
|
||||
Reference in New Issue
Block a user