From 7667b979a0d0d42e671d4d51935df37a1c9440e9 Mon Sep 17 00:00:00 2001 From: Jakub Grzywacz Date: Fri, 29 Nov 2024 10:26:03 +0100 Subject: [PATCH 1/2] fix: add default value for k1...4 --- src/elements/filters/FeComposite.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/elements/filters/FeComposite.tsx b/src/elements/filters/FeComposite.tsx index 269650f85..4968218f0 100644 --- a/src/elements/filters/FeComposite.tsx +++ b/src/elements/filters/FeComposite.tsx @@ -30,6 +30,10 @@ export default class FeComposite extends FilterPrimitive { static defaultProps = { ...this.defaultPrimitiveProps, + k1: 0, + k2: 0, + k3: 0, + k4: 0, }; render() { From d8cf917c08bd32fc83bfc92b3f83427c8715c87c Mon Sep 17 00:00:00 2001 From: Jakub Grzywacz Date: Mon, 2 Dec 2024 13:31:33 +0100 Subject: [PATCH 2/2] fix: use NSNumber instead of int --- apple/Filters/RNSVGFeComposite.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apple/Filters/RNSVGFeComposite.mm b/apple/Filters/RNSVGFeComposite.mm index 4aa9dc1f1..2195726d1 100644 --- a/apple/Filters/RNSVGFeComposite.mm +++ b/apple/Filters/RNSVGFeComposite.mm @@ -179,10 +179,10 @@ - (CIImage *)applyFilter:(NSMutableDictionary *)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"];