Skip to content

Commit

Permalink
added support for transparent fills and gradient fills
Browse files Browse the repository at this point in the history
  • Loading branch information
slayyden authored and Keavon committed Apr 27, 2024
1 parent 3a35ce2 commit b4b4f34
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,19 @@ impl LayerNodeIdentifier {
pub fn filled(&self, network: &NodeNetwork) -> bool {
use graph_craft::document::value::TaggedValue;
use graph_craft::document::NodeInput;
use graphene_core::vector::style::FillType;

// TODO: make more concise
network.upstream_flow_back_from_nodes(vec![self.to_node()], true).any(|(document_node, _)| {
document_node.name == "Fill"
&& document_node.inputs.iter().any(|node_input| match node_input {
NodeInput::Value { tagged_value, .. } => match tagged_value {
TaggedValue::OptionalColor(optional_color) => match optional_color {
// TODO: Check if color is not fully transparent
Some(_color) => true,
Some(color) => color.a() > f32::EPSILON,
_ => false,
},
TaggedValue::FillType(fill_type) => match fill_type {
FillType::Gradient => true,
_ => false,
},
_ => false,
Expand Down

0 comments on commit b4b4f34

Please sign in to comment.