mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Remove the 'Threshold' node's "Luminance Calculation" parameter (#4528)
Remove the 'Threshold' node's luminance calculation dropdown so it always compares the Rec. 601 luma
This commit is contained in:
@@ -1647,16 +1647,9 @@ pub(crate) fn threshold_properties(node_id: NodeId, context: &mut NodeProperties
|
||||
|
||||
let params: &[(ParameterRef, Color, f64)] = &[(MinLuminanceInput.into(), Color::BLACK, 50.), (MaxLuminanceInput.into(), Color::WHITE, 100.)];
|
||||
|
||||
let mut layout = Vec::with_capacity(3);
|
||||
let mut layout = Vec::with_capacity(2);
|
||||
build_shared_spectrum_section(node_id, context, params, &mut layout);
|
||||
|
||||
let luminance_calc = {
|
||||
let mut info = ParameterWidgetsInfo::new(node_id, LuminanceCalcInput, true, context);
|
||||
info.exposable = false;
|
||||
enum_choice::<LuminanceCalculation>().for_socket(info).property_row()
|
||||
};
|
||||
layout.push(luminance_calc);
|
||||
|
||||
layout
|
||||
}
|
||||
|
||||
|
||||
@@ -2182,6 +2182,19 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
|
||||
}
|
||||
}
|
||||
|
||||
// The Threshold node's luminance calculation input was retired
|
||||
if reference == DefinitionIdentifier::ProtoNode(graphene_std::raster_nodes::adjustments::threshold::IDENTIFIER) && inputs_count == 4 {
|
||||
let mut node_template = resolve_document_node_type(&reference)?.default_node_template();
|
||||
document.network_interface.replace_implementation(node_id, network_path, &mut node_template);
|
||||
|
||||
let old_inputs = document.network_interface.replace_inputs(node_id, network_path, &mut node_template)?;
|
||||
|
||||
for (i, input) in old_inputs.iter().enumerate().take(3) {
|
||||
document.network_interface.set_input(&InputConnector::node_at_index(*node_id, i), input.clone(), network_path);
|
||||
}
|
||||
inputs_count = 3;
|
||||
}
|
||||
|
||||
if reference == DefinitionIdentifier::ProtoNode(graphene_std::repeat::repeat_on_points::IDENTIFIER) && inputs_count == 2 {
|
||||
let mut node_template = resolve_document_node_type(&reference)?.default_node_template();
|
||||
document.network_interface.replace_implementation(node_id, network_path, &mut node_template);
|
||||
|
||||
Reference in New Issue
Block a user