mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 16:48:12 +08:00
Fix regression with migration code changed in node UI wire refactor (#2840)
Fixes
This commit is contained in:
@@ -614,16 +614,15 @@ pub fn document_migration_upgrades(document: &mut DocumentMessageHandler, reset_
|
||||
|
||||
// Make the "Quantity" parameter a u32 instead of f64
|
||||
if reference == "Sample Polyline" {
|
||||
let node_definition = resolve_document_node_type("Sample Polyline").unwrap();
|
||||
let mut new_node_template = node_definition.default_node_template();
|
||||
|
||||
// Get the inputs, obtain the quantity value, and put the inputs back
|
||||
let old_inputs = document.network_interface.replace_inputs(node_id, network_path, &mut new_node_template).unwrap();
|
||||
let quantity_value = old_inputs.get(3).cloned();
|
||||
let quantity_value = document
|
||||
.network_interface
|
||||
.input_from_connector(&InputConnector::Node { node_id: *node_id, input_index: 3 }, network_path)
|
||||
.unwrap();
|
||||
|
||||
if let Some(NodeInput::Value { tagged_value, exposed }) = quantity_value {
|
||||
if let TaggedValue::F64(value) = *tagged_value {
|
||||
let new_quantity_value = NodeInput::value(TaggedValue::U32(value as u32), exposed);
|
||||
if let NodeInput::Value { tagged_value, exposed } = quantity_value {
|
||||
if let TaggedValue::F64(value) = **tagged_value {
|
||||
let new_quantity_value = NodeInput::value(TaggedValue::U32(value as u32), *exposed);
|
||||
document.network_interface.set_input(&InputConnector::node(*node_id, 3), new_quantity_value, network_path);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user