Implement feDropShadow element
In SVG2, the Filter Effects Module Level 1 added a <feDropShadow>
element usable inside <filter>
.
Thanks to @johnl's !529 (merged) we have an implementation of the corresponding drop-shadow
filter function.
However, elements for filter primitives generally implement just this:
pub trait FilterEffect: SetAttributes + Draw {
fn resolve(
&self,
acquired_nodes: &mut AcquiredNodes<'_>,
node: &Node,
) -> Result<ResolvedPrimitive, FilterResolveError>;
}
The resolve
method returns a single ResolvedPrimitive
. However, the drop shadow effect is built from several primitives.
One option would be to change that trait method to return Result<Vec<ResolvedPrimitive>, ...>
, and then splice that vec into the list of primitives that gets generated in extract_filter_from_filter_node()
. Most primitives would return a single-element vec; the feDropShadow one would return a vec with the primitives from the filter function's implementation.