Fix crash upon setting stroke color to none

This commit is contained in:
Keavon Chambers
2023-04-06 18:11:45 -07:00
parent c16ee88b5d
commit ea02a2d53a
4 changed files with 6 additions and 6 deletions

View File

@@ -109,7 +109,7 @@ impl<'a> ModifyInputsContext<'a> {
fn stroke_set(&mut self, stroke: Stroke) {
self.modify_inputs("Stroke", false, |inputs| {
inputs[1] = NodeInput::value(TaggedValue::Color(stroke.color.unwrap_or_default()), false);
inputs[1] = NodeInput::value(TaggedValue::OptionalColor(stroke.color), false);
inputs[2] = NodeInput::value(TaggedValue::F64(stroke.weight), false);
inputs[3] = NodeInput::value(TaggedValue::VecF32(stroke.dash_lengths), false);
inputs[4] = NodeInput::value(TaggedValue::F64(stroke.dash_offset), false);

View File

@@ -722,7 +722,7 @@ fn static_nodes() -> Vec<DocumentNodeType> {
identifier: NodeImplementation::proto("graphene_core::vector::SetStrokeNode<_, _, _, _, _, _, _>"),
inputs: vec![
DocumentInputType::value("Vector Data", TaggedValue::VectorData(graphene_core::vector::VectorData::empty()), true),
DocumentInputType::value("Color", TaggedValue::Color(Color::BLACK), false),
DocumentInputType::value("Color", TaggedValue::OptionalColor(Some(Color::BLACK)), false),
DocumentInputType::value("Weight", TaggedValue::F64(0.), false),
DocumentInputType::value("Dash Lengths", TaggedValue::VecF32(Vec::new()), false),
DocumentInputType::value("Dash Offset", TaggedValue::F64(0.), false),