mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Brush tool live preview (#1116)
* Disable vector preview for brush tool * Fix brush preview * Fix warping * Left and right square brackets to change size * Add linear interpolation * Modfiy existing selected brush layer * Resolve warnings --------- Co-authored-by: Dennis Kobert <dennis@kobert.dev> Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
parent
c7d14c2a7b
commit
ed6140b4a7
@@ -1,5 +1,5 @@
|
||||
use core::marker::PhantomData;
|
||||
use dyn_any::{DynAny, StaticType, StaticTypeSized};
|
||||
use dyn_any::{StaticType, StaticTypeSized};
|
||||
|
||||
use crate::Node;
|
||||
|
||||
|
||||
@@ -274,7 +274,8 @@ fn blend_image_tuple<MapFn>(images: (ImageFrame, ImageFrame), map_fn: &'any_inpu
|
||||
where
|
||||
MapFn: for<'any_input> Node<'any_input, (Color, Color), Output = Color> + 'input + Clone,
|
||||
{
|
||||
let (mut background, foreground) = images;
|
||||
let (background, foreground) = images;
|
||||
|
||||
let node = BlendImageNode::new(ClonedNode::new(background), ValueNode::new(map_fn.clone()));
|
||||
node.eval(foreground)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use graph_craft::document::value::UpcastNode;
|
||||
use graph_craft::document::NodeId;
|
||||
use graph_craft::executor::Executor;
|
||||
use graph_craft::proto::{ConstructionArgs, ProtoNetwork, ProtoNode, TypingContext};
|
||||
use graph_craft::{Type, TypeDescriptor};
|
||||
use graph_craft::Type;
|
||||
use graphene_std::any::{Any, TypeErasedPinned, TypeErasedPinnedRef};
|
||||
|
||||
use crate::node_registry;
|
||||
|
||||
@@ -21,7 +21,7 @@ use graph_craft::proto::NodeConstructor;
|
||||
|
||||
use graphene_core::{concrete, fn_type, generic, value_fn};
|
||||
use graphene_std::memo::{CacheNode, LetNode};
|
||||
use graphene_std::raster::{BlendImageTupleNode, MapImageFrameNode};
|
||||
use graphene_std::raster::BlendImageTupleNode;
|
||||
|
||||
use crate::executor::NodeContainer;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ use proc_macro::TokenStream;
|
||||
use proc_macro2::Span;
|
||||
use quote::{format_ident, ToTokens};
|
||||
use syn::{
|
||||
parse_macro_input, punctuated::Punctuated, token::Comma, FnArg, GenericParam, Ident, ItemFn, Lifetime, Pat, PatIdent, PatType, PathArguments, PredicateType, ReturnType, Token, TraitBound, Type,
|
||||
TypeParam, TypeParamBound, WhereClause, WherePredicate,
|
||||
parse_macro_input, punctuated::Punctuated, token::Comma, FnArg, GenericParam, Ident, ItemFn, Lifetime, Pat, PatIdent, PathArguments, PredicateType, ReturnType, Token, TraitBound, Type, TypeParam,
|
||||
TypeParamBound, WhereClause, WherePredicate,
|
||||
};
|
||||
|
||||
#[proc_macro_attribute]
|
||||
@@ -51,7 +51,7 @@ pub fn node_fn(attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
.filter(|gen| {
|
||||
if let GenericParam::Type(ty) = gen {
|
||||
!function.sig.inputs.iter().take(1).any(|param_ty| match param_ty {
|
||||
FnArg::Typed(pat_ty) => pat_ty.ty.to_token_stream().to_string() == ty.ident.to_string(),
|
||||
FnArg::Typed(pat_ty) => ty.ident == pat_ty.ty.to_token_stream().to_string(),
|
||||
_ => false,
|
||||
})
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user