diff --git a/editor/src/messages/dialog/simple_dialogs/about_graphite_dialog.rs b/editor/src/messages/dialog/simple_dialogs/about_graphite_dialog.rs index 13c52dbc0f..414ae311c0 100644 --- a/editor/src/messages/dialog/simple_dialogs/about_graphite_dialog.rs +++ b/editor/src/messages/dialog/simple_dialogs/about_graphite_dialog.rs @@ -21,8 +21,8 @@ impl DialogLayoutHolder for AboutGraphiteDialog { fn layout_column_2(&self) -> Layout { let links = [ ("Heart", "Donate", "https://graphite.rs/donate/"), - ("Volunteer", "Volunteer", "https://graphite.rs/volunteer/"), ("GraphiteLogo", "Website", "https://graphite.rs"), + ("Volunteer", "Volunteer", "https://graphite.rs/volunteer/"), ("Credits", "Credits", "https://github.com/GraphiteEditor/Graphite/graphs/contributors"), ]; let mut widgets = links diff --git a/editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs b/editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs index c6fa781b0e..2da1a34fed 100644 --- a/editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs +++ b/editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs @@ -2021,47 +2021,6 @@ fn static_input_properties() -> InputProperties { Ok(vec![cellular_jitter.into()]) }), ); - map.insert( - "brightness".to_string(), - Box::new(|node_id, index, context| { - let document_node = node_properties::get_document_node(node_id, context)?; - let is_use_classic = document_node - .inputs - .iter() - .find_map(|input| match input.as_value() { - Some(&TaggedValue::Bool(use_classic)) => Some(use_classic), - _ => None, - }) - .unwrap_or(false); - let (b_min, b_max) = if is_use_classic { (-100., 100.) } else { (-100., 150.) }; - let brightness = node_properties::number_widget( - ParameterWidgetsInfo::new(node_id, index, true, context), - NumberInput::default().mode_range().range_min(Some(b_min)).range_max(Some(b_max)).unit("%").display_decimal_places(2), - ); - Ok(vec![brightness.into()]) - }), - ); - map.insert( - "contrast".to_string(), - Box::new(|node_id, index, context| { - let document_node = node_properties::get_document_node(node_id, context)?; - - let is_use_classic = document_node - .inputs - .iter() - .find_map(|input| match input.as_value() { - Some(&TaggedValue::Bool(use_classic)) => Some(use_classic), - _ => None, - }) - .unwrap_or(false); - let (c_min, c_max) = if is_use_classic { (-100., 100.) } else { (-50., 100.) }; - let contrast = node_properties::number_widget( - ParameterWidgetsInfo::new(node_id, index, true, context), - NumberInput::default().mode_range().range_min(Some(c_min)).range_max(Some(c_max)).unit("%").display_decimal_places(2), - ); - Ok(vec![contrast.into()]) - }), - ); map.insert( "assign_colors_gradient".to_string(), Box::new(|node_id, index, context| { @@ -2091,21 +2050,6 @@ fn static_input_properties() -> InputProperties { Ok(vec![repeat_every_row.into()]) }), ); - map.insert( - "mask_stencil".to_string(), - Box::new(|node_id, index, context| { - let mask = node_properties::color_widget(ParameterWidgetsInfo::new(node_id, index, true, context), ColorInput::default()); - Ok(vec![mask]) - }), - ); - map.insert( - "spline_input".to_string(), - Box::new(|node_id, index, context| { - Ok(vec![LayoutGroup::Row { - widgets: node_properties::array_of_vec2_widget(ParameterWidgetsInfo::new(node_id, index, true, context), TextInput::default().centered(true)), - }]) - }), - ); map.insert( "transform_rotation".to_string(), Box::new(|node_id, index, context| { diff --git a/editor/src/messages/portfolio/document/node_graph/node_properties.rs b/editor/src/messages/portfolio/document/node_graph/node_properties.rs index 349b9d9365..6371d8d0e8 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_properties.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_properties.rs @@ -232,7 +232,12 @@ pub(crate) fn property_from_type( .tooltip(format!( "This data can only be supplied through the node graph because no widget exists for its type:\n\ {}", - concrete_type.name + // TODO: Avoid needing to remove spaces here by fixing how `alias` is generated + concrete_type + .alias + .as_deref() + .map(|s| s.to_string().replace(" ", "")) + .unwrap_or_else(|| graphene_std::format_type(concrete_type.name.as_ref())) )) .widget_holder(), ]); @@ -1087,7 +1092,9 @@ pub(crate) fn brightness_contrast_properties(node_id: NodeId, context: &mut Node return Vec::new(); } }; - let use_classic_value = match document_node.inputs[UseClassicInput::INDEX].as_value() { + let use_classic_value = document_node.inputs.get(UseClassicInput::INDEX); + let includes_use_classic = use_classic_value.is_some(); + let use_classic_value = match use_classic_value.and_then(|input| input.as_value()) { Some(TaggedValue::Bool(use_classic_choice)) => *use_classic_choice, _ => false, }; @@ -1114,11 +1121,11 @@ pub(crate) fn brightness_contrast_properties(node_id: NodeId, context: &mut Node .range_max(Some(100.)), ); - let layout = vec![ - LayoutGroup::Row { widgets: brightness }, - LayoutGroup::Row { widgets: contrast }, - LayoutGroup::Row { widgets: use_classic }, - ]; + let mut layout = vec![LayoutGroup::Row { widgets: brightness }, LayoutGroup::Row { widgets: contrast }]; + if includes_use_classic { + // TODO: When we no longer use this function in the temporary "Brightness/Contrast Classic" node, remove this conditional pushing and just always include this + layout.push(LayoutGroup::Row { widgets: use_classic }); + } layout } @@ -1596,18 +1603,11 @@ pub(crate) fn generate_node_properties(node_id: NodeId, context: &mut NodeProper return Vec::new(); }; - let mut input_types = implementations - .keys() - .filter_map(|item| item.inputs.get(input_index)) - .filter(|ty| property_from_type(node_id, input_index, ty, number_options, unit_suffix, display_decimal_places, step, context).is_ok()) - .collect::>(); + let mut input_types = implementations.keys().filter_map(|item| item.inputs.get(input_index)).collect::>(); input_types.sort_by_key(|ty| ty.type_name()); let input_type = input_types.first().cloned(); - let Some(input_type) = input_type else { - return Vec::new(); - }; - + let Some(input_type) = input_type else { return Vec::new() }; input_type.clone() } _ => context diff --git a/node-graph/libraries/core-types/src/types.rs b/node-graph/libraries/core-types/src/types.rs index 64c742618a..b8bb9873a3 100644 --- a/node-graph/libraries/core-types/src/types.rs +++ b/node-graph/libraries/core-types/src/types.rs @@ -354,7 +354,7 @@ impl Type { } } -fn format_type(ty: &str) -> String { +pub fn format_type(ty: &str) -> String { ty.split('<') .map(|path| path.split(',').map(|path| path.split("::").last().unwrap_or(path)).collect::>().join(",")) .collect::>() diff --git a/node-graph/nodes/raster/src/adjustments.rs b/node-graph/nodes/raster/src/adjustments.rs index 2cd1e8ca63..9d19457969 100644 --- a/node-graph/nodes/raster/src/adjustments.rs +++ b/node-graph/nodes/raster/src/adjustments.rs @@ -141,9 +141,9 @@ fn make_opaque>( input } -/// See [`brightness_contrast`] +// TODO: Remove this once GPU shader nodes are able to support the non-classic algorithm #[node_macro::node( - name("Brightness/Contrast classic"), + name("Brightness/Contrast Classic"), category("Raster: Adjustment"), properties("brightness_contrast_properties"), shader_node(PerPixelAdjust)