Fix text tool broken by #1543 (#1555)

Text tool setting font as f32
This commit is contained in:
0HyperCube
2024-01-07 13:45:32 +00:00
committed by GitHub
parent cd61daf869
commit c14c6fbe93
5 changed files with 12 additions and 12 deletions
@@ -92,7 +92,7 @@ pub enum GraphOperationMessage {
id: NodeId,
text: String,
font: Font,
size: f64,
size: f32,
parent: LayerNodeIdentifier,
insert_index: isize,
},
@@ -205,13 +205,13 @@ impl<'a> ModifyInputsContext<'a> {
self.responses.add(NodeGraphMessage::SendGraph { should_rerender: true });
}
fn insert_text(&mut self, text: String, font: Font, size: f64, layer: NodeId) {
fn insert_text(&mut self, text: String, font: Font, size: f32, layer: NodeId) {
let text = resolve_document_node_type("Text").expect("Text node does not exist").to_document_node(
[
NodeInput::Network(graph_craft::concrete!(graphene_std::wasm_application_io::WasmEditorApi)),
NodeInput::value(TaggedValue::String(text), false),
NodeInput::value(TaggedValue::Font(font), false),
NodeInput::value(TaggedValue::F64(size), false),
NodeInput::value(TaggedValue::F32(size), false),
],
Default::default(),
);
@@ -2483,7 +2483,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
NodeInput::Network(concrete!(application_io::EditorApi<graphene_std::wasm_application_io::WasmApplicationIo>)),
NodeInput::Network(concrete!(String)),
NodeInput::Network(concrete!(graphene_core::text::Font)),
NodeInput::Network(concrete!(f64)),
NodeInput::Network(concrete!(f32)),
],
implementation: DocumentNodeImplementation::Unresolved(ProtoNodeIdentifier::new("graphene_core::text::TextGeneratorNode<_, _, _>")),
..Default::default()