Skip to content

Commit 9999d9c

Browse files
committed
added support for transparent fills and gradient fills
1 parent d29bb8d commit 9999d9c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

editor/src/messages/portfolio/document/utility_types/document_metadata.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,19 @@ impl LayerNodeIdentifier {
525525
pub fn filled(&self, network: &NodeNetwork) -> bool {
526526
use graph_craft::document::value::TaggedValue;
527527
use graph_craft::document::NodeInput;
528+
use graphene_core::vector::style::FillType;
528529

529530
// TODO: make more concise
530531
network.upstream_flow_back_from_nodes(vec![self.to_node()], true).any(|(document_node, _)| {
531532
document_node.name == "Fill"
532533
&& document_node.inputs.iter().any(|node_input| match node_input {
533534
NodeInput::Value { tagged_value, .. } => match tagged_value {
534535
TaggedValue::OptionalColor(optional_color) => match optional_color {
535-
// TODO: Check if color is not fully transparent
536-
Some(_color) => true,
536+
Some(color) => color.a() > f32::EPSILON,
537+
_ => false,
538+
},
539+
TaggedValue::FillType(fill_type) => match fill_type {
540+
FillType::Gradient => true,
537541
_ => false,
538542
},
539543
_ => false,

0 commit comments

Comments
 (0)