Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: FeComposite add default value for k1...4 #2557

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apple/Filters/RNSVGFeComposite.mm
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ - (CIImage *)applyFilter:(NSMutableDictionary<NSString *, CIImage *> *)results p
} else if (self.operator1 == SVG_FECOMPOSITE_OPERATOR_ARITHMETIC) {
[filter setValue:inputImage1 forKey:@"inputImage1"];
[filter setValue:inputImage2 forKey:@"inputImage2"];
[filter setValue:(self.k1 != nil ? self.k1 : 0) forKey:@"inputK1"];
[filter setValue:(self.k2 != nil ? self.k2 : 0) forKey:@"inputK2"];
[filter setValue:(self.k3 != nil ? self.k3 : 0) forKey:@"inputK3"];
[filter setValue:(self.k4 != nil ? self.k4 : 0) forKey:@"inputK4"];
[filter setValue:(self.k1 != nil ? self.k1 : @0) forKey:@"inputK1"];
[filter setValue:(self.k2 != nil ? self.k2 : @0) forKey:@"inputK2"];
[filter setValue:(self.k3 != nil ? self.k3 : @0) forKey:@"inputK3"];
[filter setValue:(self.k4 != nil ? self.k4 : @0) forKey:@"inputK4"];
} else {
[filter setValue:inputImage1 forKey:@"inputImage"];
[filter setValue:inputImage2 forKey:@"inputBackgroundImage"];
Expand Down
4 changes: 4 additions & 0 deletions src/elements/filters/FeComposite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export default class FeComposite extends FilterPrimitive<FeCompositeProps> {

static defaultProps = {
...this.defaultPrimitiveProps,
k1: 0,
k2: 0,
k3: 0,
k4: 0,
};

render() {
Expand Down
Loading