mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 15:28:12 +08:00
Separate the Text node's generated glyphs into separate vector table rows (#2821)
* Separate glyphs into Vector data rows * Fix `String Length` node - Properly count characters with `str.chars().count()` instead of bytes `str.len()` - Change `String Length` node's output to `u32` * Apply transform on instance instead of applying it when drawing the glyph * Add checkbox to enable/disable per-glyph instances * Tooltips --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
c5800aa96e
commit
166eb00c9c
@@ -635,7 +635,7 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
|
||||
}
|
||||
|
||||
// Upgrade Text node to include line height and character spacing, which were previously hardcoded to 1, from https://github.com/GraphiteEditor/Graphite/pull/2016
|
||||
if reference == "Text" && inputs_count != 9 {
|
||||
if reference == "Text" && inputs_count != 10 {
|
||||
let mut template = resolve_document_node_type(reference)?.default_node_template();
|
||||
document.network_interface.replace_implementation(node_id, network_path, &mut template);
|
||||
let old_inputs = document.network_interface.replace_inputs(node_id, network_path, &mut template)?;
|
||||
@@ -689,6 +689,15 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
|
||||
},
|
||||
network_path,
|
||||
);
|
||||
document.network_interface.set_input(
|
||||
&InputConnector::node(*node_id, 9),
|
||||
if inputs_count >= 10 {
|
||||
old_inputs[9].clone()
|
||||
} else {
|
||||
NodeInput::value(TaggedValue::Bool(false), false)
|
||||
},
|
||||
network_path,
|
||||
);
|
||||
}
|
||||
|
||||
// Upgrade Sine, Cosine, and Tangent nodes to include a boolean input for whether the output should be in radians, which was previously the only option but is now not the default
|
||||
|
||||
Reference in New Issue
Block a user