mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 07:48:11 +08:00
Replace terminology "primary" with "call argument" and "parameter" with "secondary input"
This commit is contained in:
@@ -2495,17 +2495,17 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
|
||||
let NodeMetadata { display_name, category, fields } = metadata;
|
||||
let Some(implementations) = &node_registry.get(&id) else { continue };
|
||||
let valid_inputs: HashSet<_> = implementations.iter().map(|(_, node_io)| node_io.input.clone()).collect();
|
||||
let valid_inputs: HashSet<_> = implementations.iter().map(|(_, node_io)| node_io.call_argument.clone()).collect();
|
||||
let first_node_io = implementations.first().map(|(_, node_io)| node_io).unwrap_or(const { &NodeIOTypes::empty() });
|
||||
let mut input_type = &first_node_io.input;
|
||||
let mut input_type = &first_node_io.call_argument;
|
||||
if valid_inputs.len() > 1 {
|
||||
input_type = &const { generic!(T) };
|
||||
}
|
||||
let output_type = &first_node_io.output;
|
||||
let output_type = &first_node_io.return_value;
|
||||
|
||||
let inputs = fields
|
||||
.iter()
|
||||
.zip(first_node_io.parameters.iter())
|
||||
.zip(first_node_io.inputs.iter())
|
||||
.enumerate()
|
||||
.map(|(index, (field, ty))| {
|
||||
let exposed = if index == 0 { *ty != fn_type!(()) } else { field.exposed };
|
||||
@@ -2526,7 +2526,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
let properties = match properties_overrides.get(id.as_str()) {
|
||||
Some(properties_function) => *properties_function,
|
||||
None => {
|
||||
let field_types: Vec<_> = fields.iter().zip(first_node_io.parameters.iter()).map(|(field, ty)| (field.clone(), ty.clone())).collect();
|
||||
let field_types: Vec<_> = fields.iter().zip(first_node_io.inputs.iter()).map(|(field, ty)| (field.clone(), ty.clone())).collect();
|
||||
let properties = move |document_node: &DocumentNode, node_id: NodeId, context: &mut NodePropertiesContext| {
|
||||
let rows: Vec<_> = field_types
|
||||
.iter()
|
||||
|
||||
@@ -511,7 +511,7 @@ impl NodeNetworkInterface {
|
||||
}
|
||||
}
|
||||
DocumentNodeImplementation::ProtoNode(_) => {
|
||||
// If a node has manual composition, then offset the input index by 1 since the proto node also includes the type of the parameter passed through manual composition.
|
||||
// If a node has manual composition, then offset the input index by 1 since the proto node also includes the type of the input passed through manual composition.
|
||||
let manual_composition_offset = if node.manual_composition.is_some() { 1 } else { 0 };
|
||||
self.resolved_types
|
||||
.types
|
||||
@@ -552,7 +552,7 @@ impl NodeNetworkInterface {
|
||||
|
||||
let skip_footprint = if node.manual_composition.is_some() { 1 } else { 0 };
|
||||
|
||||
let Some(input_type) = std::iter::once(node_types.input.clone()).chain(node_types.parameters.clone()).nth(input_index + skip_footprint) else {
|
||||
let Some(input_type) = std::iter::once(node_types.call_argument.clone()).chain(node_types.inputs.clone()).nth(input_index + skip_footprint) else {
|
||||
log::error!("Could not get type");
|
||||
return (concrete!(()), TypeSource::Error("could not get the protonode's input"));
|
||||
};
|
||||
@@ -678,7 +678,7 @@ impl NodeNetworkInterface {
|
||||
let node_id_path = &[network_path, &[*node_id]].concat();
|
||||
let primary_output_type = self.resolved_types.types.get(node_id_path).map(|ty| (ty.output.clone(), TypeSource::Compiled)).or_else(|| {
|
||||
let node_types = random_protonode_implementation(protonode)?;
|
||||
Some((node_types.output.clone(), TypeSource::RandomProtonodeImplementation))
|
||||
Some((node_types.return_value.clone(), TypeSource::RandomProtonodeImplementation))
|
||||
});
|
||||
|
||||
output_types.push(primary_output_type);
|
||||
|
||||
@@ -105,7 +105,7 @@ pub fn get_blend_mode(layer: LayerNodeIdentifier, network_interface: &NodeNetwor
|
||||
/// Get the current opacity of a layer from the closest Opacity node.
|
||||
/// This may differ from the actual opacity contained within the data type reaching this layer, because that actual opacity may be:
|
||||
/// - Multiplied with additional opacity nodes earlier in the chain
|
||||
/// - Set by an Opacity node with an exposed parameter value driven by another node
|
||||
/// - Set by an Opacity node with an exposed input value driven by another node
|
||||
/// - Already factored into the pixel alpha channel of an image
|
||||
/// - The default value of 100% if no Opacity node is present, but this function returns None in that case
|
||||
///
|
||||
|
||||
@@ -330,7 +330,7 @@ impl Fsm for BrushToolFsmState {
|
||||
|
||||
let layer_document_scale = document.metadata().transform_to_document(parent) * tool_data.transform;
|
||||
|
||||
// TODO: Also scale it based on the input image ('Background' parameter).
|
||||
// TODO: Also scale it based on the input image ('Background' input).
|
||||
// TODO: Resizing the input image results in a different brush size from the chosen diameter.
|
||||
let layer_scale = 0.0001_f64 // Safety against division by zero
|
||||
.max((layer_document_scale.matrix2 * glam::DVec2::X).length())
|
||||
|
||||
Reference in New Issue
Block a user