diff --git a/Example/examples.js b/Example/examples.js
index 5cd2a8a2..d9992710 100644
--- a/Example/examples.js
+++ b/Example/examples.js
@@ -12,6 +12,7 @@ import * as Stroking from './examples/Stroking';
import * as Use from './examples/Use';
import * as Symbol from './examples/Symbol';
import * as Gradients from './examples/Gradients';
+import * as Clipping from './examples/Clipping';
export {
Svg,
@@ -27,5 +28,6 @@ export {
G,
Use,
Symbol,
- Gradients
+ Gradients,
+ Clipping
};
diff --git a/Example/examples/Clipping.js b/Example/examples/Clipping.js
new file mode 100644
index 00000000..6e0a5795
--- /dev/null
+++ b/Example/examples/Clipping.js
@@ -0,0 +1,124 @@
+import React, {
+ Component
+} from 'react-native';
+
+import Svg, {
+ GlipPath,
+ Defs,
+ Line,
+ Rect,
+ Text,
+ G
+} from 'react-native-art-svg';
+
+class ClipPathExample extends Component{
+ static title = 'Clip by set clip-path with a path data';
+ render() {
+ return ;
+ }
+}
+
+class ClipRulePathExample extends Component{
+ static title = 'Clip by set clip-path with a path data';
+ render() {
+ return ;
+ }
+}
+
+const icon = ;
+
+const samples = [ClipPathExample, ClipRulePathExample];
+
+export {
+ icon,
+ samples
+}
diff --git a/Example/ios/ArtSvgExample/AppDelegate.m b/Example/ios/ArtSvgExample/AppDelegate.m
index 9a61bad2..9aec03d5 100644
--- a/Example/ios/ArtSvgExample/AppDelegate.m
+++ b/Example/ios/ArtSvgExample/AppDelegate.m
@@ -36,7 +36,9 @@
/**
* OPTION 2
* Load from pre-bundled file on disk. The static bundle is automatically
- * generated by "Bundle React Native code and images" build step.
+ * generated by the "Bundle React Native code and images" build step when
+ * running the project on an actual device or running the project on the
+ * simulator in the "Release" build configuration.
*/
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
diff --git a/Example/main.js b/Example/main.js
index fa581bac..2f9fea27 100644
--- a/Example/main.js
+++ b/Example/main.js
@@ -24,19 +24,21 @@ import {
} from 'react-native-art-svg';
import * as examples from './examples';
import Modal from 'react-native-root-modal';
-const hairline = 1 / PixelRatio.get();
+const hairline = StyleSheet.hairlineWidth;
const styles = StyleSheet.create({
container: {
flex: 1,
- backgroundColor: '#F5FCFF',
paddingTop: 20,
alignItems: 'center',
overflow: 'hidden'
},
content: {
+ flex: 1,
+ alignSelf: 'stretch'
+ },
+ contentContainer: {
alignSelf: 'stretch',
- alignItems: 'center',
borderTopWidth: hairline,
borderTopColor: '#ccc',
borderBottomWidth: hairline,
@@ -104,7 +106,7 @@ const styles = StyleSheet.create({
}
});
-const names = ['Svg', 'Stroking', 'Path', 'Line', 'Rect', 'Polygon', 'Polyline', 'Circle', 'Ellipse', 'G', 'Text', 'Use', 'Symbol', 'Gradients'];
+const names = ['Svg', 'Stroking', 'Path', 'Line', 'Rect', 'Polygon', 'Polyline', 'Circle', 'Ellipse', 'G', 'Text', 'Use', 'Symbol', 'Gradients', 'Clipping'];
class ArtSvgExample extends Component {
constructor() {
@@ -184,7 +186,9 @@ class ArtSvgExample extends Component {
};
render() {
- return
+ return
SVG by ART!
-
+
{this.getExamples()}
-
+
;
}
}
diff --git a/android/src/main/java/com/horcrux/svg/RNSVGPathShadowNode.java b/android/src/main/java/com/horcrux/svg/RNSVGPathShadowNode.java
index 7ca0b878..66ba4cb8 100644
--- a/android/src/main/java/com/horcrux/svg/RNSVGPathShadowNode.java
+++ b/android/src/main/java/com/horcrux/svg/RNSVGPathShadowNode.java
@@ -253,6 +253,7 @@ public class RNSVGPathShadowNode extends RNSVGVirtualNode {
stops = new float[stopsCount];
parseGradientStops(mFillColor, stopsCount, stops, stopsColors, 7);
+ // TODO:
float focusX = mFillColor[1];
float focusY = mFillColor[2];
diff --git a/ios/Brushes/RNSVGBrush.h b/ios/Brushes/RNSVGBrush.h
index 7a044bda..0357a690 100644
--- a/ios/Brushes/RNSVGBrush.h
+++ b/ios/Brushes/RNSVGBrush.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
diff --git a/ios/Brushes/RNSVGBrush.m b/ios/Brushes/RNSVGBrush.m
index c1e0fbca..387ab1d3 100644
--- a/ios/Brushes/RNSVGBrush.m
+++ b/ios/Brushes/RNSVGBrush.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGBrush.h"
@@ -15,19 +14,19 @@
- (instancetype)initWithArray:(NSArray *)data
{
- return [super init];
+ return [super init];
}
RCT_NOT_IMPLEMENTED(- (instancetype)init)
- (BOOL)applyFillColor:(CGContextRef)context
{
- return NO;
+ return NO;
}
- (void)paint:(CGContextRef)context
{
- // abstract
+ // abstract
}
@end
diff --git a/ios/Brushes/RNSVGLinearGradient.h b/ios/Brushes/RNSVGLinearGradient.h
index 95cb73eb..48d19a78 100644
--- a/ios/Brushes/RNSVGLinearGradient.h
+++ b/ios/Brushes/RNSVGLinearGradient.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGBrush.h"
diff --git a/ios/Brushes/RNSVGLinearGradient.m b/ios/Brushes/RNSVGLinearGradient.m
index 5294ccfb..343ea180 100644
--- a/ios/Brushes/RNSVGLinearGradient.m
+++ b/ios/Brushes/RNSVGLinearGradient.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGLinearGradient.h"
diff --git a/ios/Brushes/RNSVGPattern.h b/ios/Brushes/RNSVGPattern.h
index 44259d6b..b0a622c9 100644
--- a/ios/Brushes/RNSVGPattern.h
+++ b/ios/Brushes/RNSVGPattern.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGBrush.h"
diff --git a/ios/Brushes/RNSVGPattern.m b/ios/Brushes/RNSVGPattern.m
index a08930af..e461eb0a 100644
--- a/ios/Brushes/RNSVGPattern.m
+++ b/ios/Brushes/RNSVGPattern.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGPattern.h"
diff --git a/ios/Brushes/RNSVGRadialGradient.h b/ios/Brushes/RNSVGRadialGradient.h
index b1472c36..fb1aef02 100644
--- a/ios/Brushes/RNSVGRadialGradient.h
+++ b/ios/Brushes/RNSVGRadialGradient.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGBrush.h"
diff --git a/ios/Brushes/RNSVGRadialGradient.m b/ios/Brushes/RNSVGRadialGradient.m
index aecfc275..f15fe904 100644
--- a/ios/Brushes/RNSVGRadialGradient.m
+++ b/ios/Brushes/RNSVGRadialGradient.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGRadialGradient.h"
diff --git a/ios/Brushes/RNSVGSolidColor.h b/ios/Brushes/RNSVGSolidColor.h
index 857e612e..db37d880 100644
--- a/ios/Brushes/RNSVGSolidColor.h
+++ b/ios/Brushes/RNSVGSolidColor.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGBrush.h"
diff --git a/ios/Brushes/RNSVGSolidColor.m b/ios/Brushes/RNSVGSolidColor.m
index 028b7d3b..a1c05d56 100644
--- a/ios/Brushes/RNSVGSolidColor.m
+++ b/ios/Brushes/RNSVGSolidColor.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGSolidColor.h"
diff --git a/ios/RCTConvert+RNSVG.h b/ios/RCTConvert+RNSVG.h
index a1406b08..fa94a980 100644
--- a/ios/RCTConvert+RNSVG.h
+++ b/ios/RCTConvert+RNSVG.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
@@ -13,13 +12,13 @@
#import "RNSVGCGFloatArray.h"
#import "RNSVGTextFrame.h"
#import "RCTConvert.h"
-#import "RNSVGCGFillRule.h"
+#import "RNSVGCGFCRule.h"
@interface RCTConvert (RNSVG)
+ (CGPathRef)CGPath:(id)json;
+ (CTTextAlignment)CTTextAlignment:(id)json;
-+ (RNSVGCGFillRule)ARTCGFillRule:(id)json;
++ (RNSVGCGFCRule)RNSVGCGFCRule:(id)json;
+ (RNSVGTextFrame)RNSVGTextFrame:(id)json;
+ (RNSVGCGFloatArray)RNSVGCGFloatArray:(id)json;
+ (RNSVGBrush *)RNSVGBrush:(id)json;
diff --git a/ios/RCTConvert+RNSVG.m b/ios/RCTConvert+RNSVG.m
index f9ad8423..c03d8931 100644
--- a/ios/RCTConvert+RNSVG.m
+++ b/ios/RCTConvert+RNSVG.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RCTConvert+RNSVG.h"
@@ -14,7 +13,7 @@
#import "RNSVGRadialGradient.h"
#import "RNSVGSolidColor.h"
#import "RCTLog.h"
-#import "RNSVGCGFillRule.h"
+#import "RNSVGCGFCRule.h"
@implementation RCTConvert (RNSVG)
@@ -73,10 +72,10 @@ RCT_ENUM_CONVERTER(CTTextAlignment, (@{
@"justify": @(kCTTextAlignmentJustified),
}), kCTTextAlignmentNatural, integerValue)
-RCT_ENUM_CONVERTER(RNSVGCGFillRule, (@{
- @"evenodd": @(kARTCGFillRuleEvenodd),
- @"nonzero": @(kARTCGFillRuleNonzero),
-}), kARTCGFillRuleEvenodd, intValue)
+RCT_ENUM_CONVERTER(RNSVGCGFCRule, (@{
+ @"evenodd": @(kRNSVGCGFCRuleEvenodd),
+ @"nonzero": @(kRNSVGCGFCRuleNonzero),
+}), kRNSVGCGFCRuleNonzero, intValue)
// This takes a tuple of text lines and a font to generate a CTLine for each text line.
// This prepares everything for rendering a frame of text in RNSVGText.
diff --git a/ios/RNSVG.xcodeproj/project.pbxproj b/ios/RNSVG.xcodeproj/project.pbxproj
index 93a7f975..e330791f 100644
--- a/ios/RNSVG.xcodeproj/project.pbxproj
+++ b/ios/RNSVG.xcodeproj/project.pbxproj
@@ -80,7 +80,7 @@
10A063011CC7320C0000CEEF /* RNSVGPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNSVGPath.m; sourceTree = ""; };
10A063021CC7320C0000CEEF /* RNSVGSvgView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNSVGSvgView.h; sourceTree = ""; };
10A063031CC7320C0000CEEF /* RNSVGSvgView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNSVGSvgView.m; sourceTree = ""; };
- 10FEAC6A1CC7D05200F1C23C /* RNSVGCGFillRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNSVGCGFillRule.h; sourceTree = ""; };
+ 10FEAC6A1CC7D05200F1C23C /* RNSVGCGFCRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNSVGCGFCRule.h; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -100,7 +100,7 @@
0CF68AEA1AF0549300FF9E5C /* Brushes */,
0CF68AF81AF0549300FF9E5C /* ViewManagers */,
0CF68ADB1AF0549300FF9E5C /* RNSVGCGFloatArray.h */,
- 10FEAC6A1CC7D05200F1C23C /* RNSVGCGFillRule.h */,
+ 10FEAC6A1CC7D05200F1C23C /* RNSVGCGFCRule.h */,
0CF68ADC1AF0549300FF9E5C /* RNSVGContainer.h */,
0CF68ADD1AF0549300FF9E5C /* RNSVGGroup.h */,
0CF68ADE1AF0549300FF9E5C /* RNSVGGroup.m */,
diff --git a/ios/RNSVGCGFCRule.h b/ios/RNSVGCGFCRule.h
new file mode 100644
index 00000000..160b0ef3
--- /dev/null
+++ b/ios/RNSVGCGFCRule.h
@@ -0,0 +1,12 @@
+/**
+ * Copyright (c) 2015-present, Horcrux.
+ * All rights reserved.
+ *
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+typedef CF_ENUM(int32_t, RNSVGCGFCRule) {
+ kRNSVGCGFCRuleEvenodd,
+ kRNSVGCGFCRuleNonzero
+};
\ No newline at end of file
diff --git a/ios/RNSVGCGFillRule.h b/ios/RNSVGCGFillRule.h
deleted file mode 100644
index d045d6c8..00000000
--- a/ios/RNSVGCGFillRule.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * Copyright (c) 2015-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-typedef CF_ENUM(int32_t, RNSVGCGFillRule) {
- kARTCGFillRuleEvenodd,
- kARTCGFillRuleNonzero
-};
\ No newline at end of file
diff --git a/ios/RNSVGCGFloatArray.h b/ios/RNSVGCGFloatArray.h
index 0f1f03a7..4a839060 100644
--- a/ios/RNSVGCGFloatArray.h
+++ b/ios/RNSVGCGFloatArray.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
// A little helper to make sure we have the right memory allocation ready for use.
diff --git a/ios/RNSVGContainer.h b/ios/RNSVGContainer.h
index 322b6e6c..4d16332c 100644
--- a/ios/RNSVGContainer.h
+++ b/ios/RNSVGContainer.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
diff --git a/ios/RNSVGGroup.h b/ios/RNSVGGroup.h
index 73522974..f55512e7 100644
--- a/ios/RNSVGGroup.h
+++ b/ios/RNSVGGroup.h
@@ -1,17 +1,20 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
#import "RNSVGContainer.h"
#import "RNSVGNode.h"
+#import "RNSVGCGFCRule.h"
@interface RNSVGGroup : RNSVGNode
+@property (nonatomic, assign) CGPathRef clipPath;
+@property (nonatomic, assign) RNSVGCGFCRule clipRule;
+
@end
diff --git a/ios/RNSVGGroup.m b/ios/RNSVGGroup.m
index a3a2ae00..41190747 100644
--- a/ios/RNSVGGroup.m
+++ b/ios/RNSVGGroup.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGGroup.h"
@@ -13,10 +12,10 @@
- (void)renderLayerTo:(CGContextRef)context
{
-// TO-DO: Clipping rectangle
- for (RNSVGNode *node in self.subviews) {
- [node renderTo:context];
- }
+ [self clip:context];
+ for (RNSVGNode *node in self.subviews) {
+ [node renderTo:context];
+ }
}
@end
diff --git a/ios/RNSVGNode.h b/ios/RNSVGNode.h
index 1d3c25ac..4627ffdd 100644
--- a/ios/RNSVGNode.h
+++ b/ios/RNSVGNode.h
@@ -1,14 +1,14 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
#import
+#import "RNSVGCGFCRule.h"
/**
* RNSVG nodes are implemented as empty UIViews but this is just an implementation detail to fit
@@ -20,6 +20,9 @@
@property (nonatomic, assign) CGFloat opacity;
+@property (nonatomic, assign) CGPathRef clipPath;
+@property (nonatomic, assign) RNSVGCGFCRule clipRule;
+
- (void)invalidate;
- (void)renderTo:(CGContextRef)context;
@@ -30,4 +33,6 @@
*/
- (void)renderLayerTo:(CGContextRef)context;
+- (void)clip:(CGContextRef)context;
+
@end
diff --git a/ios/RNSVGNode.m b/ios/RNSVGNode.m
index bd988696..d3c3657d 100644
--- a/ios/RNSVGNode.m
+++ b/ios/RNSVGNode.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGNode.h"
@@ -15,62 +14,94 @@
- (void)insertSubview:(UIView *)subview atIndex:(NSInteger)index
{
- [self invalidate];
- [super insertSubview:subview atIndex:index];
+ [self invalidate];
+ [super insertSubview:subview atIndex:index];
}
- (void)removeFromSuperview
{
- [self invalidate];
- [super removeFromSuperview];
+ [self invalidate];
+ [super removeFromSuperview];
}
- (void)setOpacity:(CGFloat)opacity
{
- [self invalidate];
- _opacity = opacity;
+ [self invalidate];
+ _opacity = opacity;
}
- (void)setTransform:(CGAffineTransform)transform
{
- [self invalidate];
- super.transform = transform;
+ [self invalidate];
+ super.transform = transform;
}
- (void)invalidate
{
- id container = (id)self.superview;
- [container invalidate];
+ id container = (id)self.superview;
+ [container invalidate];
}
- (void)renderTo:(CGContextRef)context
{
- if (self.opacity <= 0) {
- // Nothing to paint
- return;
- }
- if (self.opacity >= 1) {
- // Just paint at full opacity
+ float opacity = self.opacity;
+ BOOL transparent = NO;
+ if (opacity <= 0) {
+ // Nothing to paint
+ return;
+ }
+ if (opacity >= 1) {
+ opacity = 1;
+ transparent = YES;
+ }
+
+ // This needs to be painted on a layer before being composited.
CGContextSaveGState(context);
CGContextConcatCTM(context, self.transform);
- CGContextSetAlpha(context, 1);
+ CGContextSetAlpha(context, opacity);
+ if (transparent) {
+ CGContextBeginTransparencyLayer(context, NULL);
+
+ }
[self renderLayerTo:context];
+ if (transparent) {
+ CGContextEndTransparencyLayer(context);
+ }
CGContextRestoreGState(context);
- return;
- }
- // This needs to be painted on a layer before being composited.
- CGContextSaveGState(context);
- CGContextConcatCTM(context, self.transform);
- CGContextSetAlpha(context, self.opacity);
- CGContextBeginTransparencyLayer(context, NULL);
- [self renderLayerTo:context];
- CGContextEndTransparencyLayer(context);
- CGContextRestoreGState(context);
}
+- (void)setClipPath:(CGPathRef)clipPath
+{
+ if (clipPath == _clipPath) {
+ return;
+ }
+ [self invalidate];
+ CGPathRelease(_clipPath);
+ _clipPath = CGPathRetain(clipPath);
+}
+
+
+- (void)dealloc
+{
+ CGPathRelease(_clipPath);
+}
+
+
- (void)renderLayerTo:(CGContextRef)context
{
- // abstract
+ // abstract
+}
+
+- (void)clip:(CGContextRef)context
+{
+ if (self.clipPath) {
+ CGContextAddPath(context, self.clipPath);
+ if (self.clipRule == kRNSVGCGFCRuleEvenodd) {
+ CGContextEOClip(context);
+ } else {
+ CGContextClip(context);
+ }
+ }
}
@end
diff --git a/ios/RNSVGPath.h b/ios/RNSVGPath.h
index c9d3acfe..e917282a 100644
--- a/ios/RNSVGPath.h
+++ b/ios/RNSVGPath.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
diff --git a/ios/RNSVGPath.m b/ios/RNSVGPath.m
index e4a3969e..d5e04fdc 100644
--- a/ios/RNSVGPath.m
+++ b/ios/RNSVGPath.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGPath.h"
@@ -13,58 +12,60 @@
- (void)setD:(CGPathRef)d
{
- if (d == _d) {
- return;
- }
- [self invalidate];
- CGPathRelease(_d);
- _d = CGPathRetain(d);
+ if (d == _d) {
+ return;
+ }
+ [self invalidate];
+ CGPathRelease(_d);
+ _d = CGPathRetain(d);
}
- (void)dealloc
{
- CGPathRelease(_d);
+ CGPathRelease(_d);
}
- (void)renderLayerTo:(CGContextRef)context
{
- if ((!self.fill && !self.stroke) || !self.d) {
- return;
- }
-
- CGPathDrawingMode mode = kCGPathStroke;
- if (self.fill) {
- if ([self.fill applyFillColor:context]) {
- mode = self.fillRule == kARTCGFillRuleEvenodd ? kCGPathEOFill : kCGPathFill;
- } else {
- CGContextSaveGState(context);
- CGContextAddPath(context, self.d);
- CGContextClip(context);
- [self.fill paint:context];
- CGContextRestoreGState(context);
- if (!self.stroke) {
+ if ((!self.fill && !self.stroke) || !self.d) {
return;
- }
}
- }
- if (self.stroke) {
- CGContextSetStrokeColorWithColor(context, self.stroke);
- CGContextSetLineWidth(context, self.strokeWidth);
- CGContextSetLineCap(context, self.strokeLinecap);
- CGContextSetLineJoin(context, self.strokeLinejoin);
- RNSVGCGFloatArray dash = self.strokeDash;
- if (dash.count) {
- CGContextSetLineDash(context, 0, dash.array, dash.count);
+
+ CGPathDrawingMode mode = kCGPathStroke;
+ if (self.fill) {
+ if ([self.fill applyFillColor:context]) {
+ mode = self.fillRule == kRNSVGCGFCRuleEvenodd ? kCGPathEOFill : kCGPathFill;
+ } else {
+ CGContextSaveGState(context);
+ CGContextAddPath(context, self.d);
+ CGContextClip(context);
+ [self.fill paint:context];
+ CGContextRestoreGState(context);
+ if (!self.stroke) {
+ return;
+ }
+ }
}
- if (mode == kCGPathFill) {
- mode = kCGPathFillStroke;
- } else if (mode == kCGPathEOFill) {
- mode = kCGPathEOFillStroke;
+ if (self.stroke) {
+ CGContextSetStrokeColorWithColor(context, self.stroke);
+ CGContextSetLineWidth(context, self.strokeWidth);
+ CGContextSetLineCap(context, self.strokeLinecap);
+ CGContextSetLineJoin(context, self.strokeLinejoin);
+ RNSVGCGFloatArray dash = self.strokeDash;
+ if (dash.count) {
+ CGContextSetLineDash(context, 0, dash.array, dash.count);
+ }
+ if (mode == kCGPathFill) {
+ mode = kCGPathFillStroke;
+ } else if (mode == kCGPathEOFill) {
+ mode = kCGPathEOFillStroke;
+ }
}
- }
-
- CGContextAddPath(context, self.d);
- CGContextDrawPath(context, mode);
+
+ [self clip:context];
+
+ CGContextAddPath(context, self.d);
+ CGContextDrawPath(context, mode);
}
@end
diff --git a/ios/RNSVGRenderable.h b/ios/RNSVGRenderable.h
index f6381df6..d955f1b1 100644
--- a/ios/RNSVGRenderable.h
+++ b/ios/RNSVGRenderable.h
@@ -1,23 +1,22 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
#import "RNSVGBrush.h"
#import "RNSVGCGFloatArray.h"
-#import "RNSVGCGFillRule.h"
+#import "RNSVGCGFCRule.h"
#import "RNSVGNode.h"
@interface RNSVGRenderable : RNSVGNode
@property (nonatomic, strong) RNSVGBrush *fill;
-@property (nonatomic, assign) RNSVGCGFillRule fillRule;
+@property (nonatomic, assign) RNSVGCGFCRule fillRule;
@property (nonatomic, assign) CGColorRef stroke;
@property (nonatomic, assign) CGFloat strokeWidth;
@property (nonatomic, assign) CGLineCap strokeLinecap;
diff --git a/ios/RNSVGRenderable.m b/ios/RNSVGRenderable.m
index 6b28c362..aa1dc20f 100644
--- a/ios/RNSVGRenderable.m
+++ b/ios/RNSVGRenderable.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGRenderable.h"
@@ -12,84 +11,78 @@
@implementation RNSVGRenderable
- (void)setFill:(RNSVGBrush *)fill
-{
- [self invalidate];
- _fill = fill;
-}
-
-- (void)setFillRule:(RNSVGCGFillRule)fillRule
{
[self invalidate];
- _fillRule = fillRule;
+ _fill = fill;
}
- (void)setStroke:(CGColorRef)stroke
{
- if (stroke == _stroke) {
- return;
- }
- [self invalidate];
- CGColorRelease(_stroke);
- _stroke = CGColorRetain(stroke);
+ if (stroke == _stroke) {
+ return;
+ }
+ [self invalidate];
+ CGColorRelease(_stroke);
+ _stroke = CGColorRetain(stroke);
}
- (void)setStrokeWidth:(CGFloat)strokeWidth
{
- [self invalidate];
- _strokeWidth = strokeWidth;
+ [self invalidate];
+ _strokeWidth = strokeWidth;
}
- (void)setStrokeLinecap:(CGLineCap)strokeLinecap
{
- [self invalidate];
- _strokeLinecap = strokeLinecap;
+ [self invalidate];
+ _strokeLinecap = strokeLinecap;
}
- (void)setStrokeJoin:(CGLineJoin)strokeLinejoin
{
- [self invalidate];
- _strokeLinejoin = strokeLinejoin;
+ [self invalidate];
+ _strokeLinejoin = strokeLinejoin;
}
- (void)setStrokeDash:(RNSVGCGFloatArray)strokeDash
{
- if (strokeDash.array == _strokeDash.array) {
- return;
- }
- if (_strokeDash.array) {
- free(_strokeDash.array);
- }
- [self invalidate];
- _strokeDash = strokeDash;
+ if (strokeDash.array == _strokeDash.array) {
+ return;
+ }
+ if (_strokeDash.array) {
+ free(_strokeDash.array);
+ }
+ [self invalidate];
+ _strokeDash = strokeDash;
}
- (void)dealloc
{
- CGColorRelease(_stroke);
- if (_strokeDash.array) {
- free(_strokeDash.array);
- }
+ CGColorRelease(_stroke);
+ if (_strokeDash.array) {
+ free(_strokeDash.array);
+ }
}
- (void)renderTo:(CGContextRef)context
{
- if (self.opacity <= 0 || self.opacity >= 1 || (self.fill && self.stroke)) {
- // If we have both fill and stroke, we will need to paint this using normal compositing
- [super renderTo: context];
- return;
- }
- // This is a terminal with only one painting. Therefore we don't need to paint this
- // off-screen. We can just composite it straight onto the buffer.
- CGContextSaveGState(context);
- CGContextConcatCTM(context, self.transform);
- CGContextSetAlpha(context, self.opacity);
- [self renderLayerTo:context];
- CGContextRestoreGState(context);
+ if (self.opacity <= 0 || self.opacity >= 1 || (self.fill && self.stroke)) {
+ // If we have both fill and stroke, we will need to paint this using normal compositing
+ [super renderTo: context];
+ return;
+ }
+ // This is a terminal with only one painting. Therefore we don't need to paint this
+ // off-screen. We can just composite it straight onto the buffer.
+ CGContextSaveGState(context);
+ CGContextConcatCTM(context, self.transform);
+ CGContextSetAlpha(context, self.opacity);
+ [self renderLayerTo:context];
+ CGContextRestoreGState(context);
}
- (void)renderLayerTo:(CGContextRef)context
{
- // abstract
+ // abstract
}
@end
diff --git a/ios/RNSVGSvgView.h b/ios/RNSVGSvgView.h
index 4984d2fe..b33f7287 100644
--- a/ios/RNSVGSvgView.h
+++ b/ios/RNSVGSvgView.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
diff --git a/ios/RNSVGSvgView.m b/ios/RNSVGSvgView.m
index 85a7252a..4f789206 100644
--- a/ios/RNSVGSvgView.m
+++ b/ios/RNSVGSvgView.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGSvgView.h"
diff --git a/ios/RNSVGText.h b/ios/RNSVGText.h
index 60dba968..408c939e 100644
--- a/ios/RNSVGText.h
+++ b/ios/RNSVGText.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
diff --git a/ios/RNSVGText.m b/ios/RNSVGText.m
index 51298b36..208dc914 100644
--- a/ios/RNSVGText.m
+++ b/ios/RNSVGText.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGText.h"
@@ -54,7 +53,8 @@ static void RNSVGFreeTextFrame(RNSVGTextFrame frame)
}
// to-do: draw along a path
-
+ // to-do: fill-rule
+ // to-do: clip
CGTextDrawingMode mode = kCGTextStroke;
if (self.fill) {
if ([self.fill applyFillColor:context]) {
diff --git a/ios/RNSVGTextFrame.h b/ios/RNSVGTextFrame.h
index f4ee86f7..ba0f2ec9 100644
--- a/ios/RNSVGTextFrame.h
+++ b/ios/RNSVGTextFrame.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import
diff --git a/ios/ViewManagers/RNSVGGroupManager.h b/ios/ViewManagers/RNSVGGroupManager.h
index 3414f09f..6c052c35 100644
--- a/ios/ViewManagers/RNSVGGroupManager.h
+++ b/ios/ViewManagers/RNSVGGroupManager.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGNodeManager.h"
diff --git a/ios/ViewManagers/RNSVGGroupManager.m b/ios/ViewManagers/RNSVGGroupManager.m
index c48fda70..fa2daa31 100644
--- a/ios/ViewManagers/RNSVGGroupManager.m
+++ b/ios/ViewManagers/RNSVGGroupManager.m
@@ -1,14 +1,13 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGGroupManager.h"
-
+#import "RNSVGCGFCRule.h"
#import "RNSVGGroup.h"
@implementation RNSVGGroupManager
@@ -20,4 +19,8 @@ RCT_EXPORT_MODULE()
return [RNSVGGroup new];
}
+
+RCT_EXPORT_VIEW_PROPERTY(clipPath, CGPath)
+RCT_EXPORT_VIEW_PROPERTY(clipRule, RNSVGCGFCRule)
+
@end
diff --git a/ios/ViewManagers/RNSVGNodeManager.h b/ios/ViewManagers/RNSVGNodeManager.h
index 4cd3eb15..c7282306 100644
--- a/ios/ViewManagers/RNSVGNodeManager.h
+++ b/ios/ViewManagers/RNSVGNodeManager.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGNode.h"
diff --git a/ios/ViewManagers/RNSVGNodeManager.m b/ios/ViewManagers/RNSVGNodeManager.m
index 6cb29a2a..0333bf6f 100644
--- a/ios/ViewManagers/RNSVGNodeManager.m
+++ b/ios/ViewManagers/RNSVGNodeManager.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGNodeManager.h"
diff --git a/ios/ViewManagers/RNSVGPathManager.h b/ios/ViewManagers/RNSVGPathManager.h
index ac71b99a..4b13dff9 100644
--- a/ios/ViewManagers/RNSVGPathManager.h
+++ b/ios/ViewManagers/RNSVGPathManager.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGRenderableManager.h"
diff --git a/ios/ViewManagers/RNSVGPathManager.m b/ios/ViewManagers/RNSVGPathManager.m
index 486322d5..97d7439d 100644
--- a/ios/ViewManagers/RNSVGPathManager.m
+++ b/ios/ViewManagers/RNSVGPathManager.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGPathManager.h"
diff --git a/ios/ViewManagers/RNSVGRenderableManager.h b/ios/ViewManagers/RNSVGRenderableManager.h
index 589ef345..1a9eea77 100644
--- a/ios/ViewManagers/RNSVGRenderableManager.h
+++ b/ios/ViewManagers/RNSVGRenderableManager.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGNodeManager.h"
diff --git a/ios/ViewManagers/RNSVGRenderableManager.m b/ios/ViewManagers/RNSVGRenderableManager.m
index dd8d3b45..53f5b25f 100644
--- a/ios/ViewManagers/RNSVGRenderableManager.m
+++ b/ios/ViewManagers/RNSVGRenderableManager.m
@@ -1,16 +1,15 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGRenderableManager.h"
#import "RCTConvert+RNSVG.h"
-#import "RNSVGCGFillRule.h"
+#import "RNSVGCGFCRule.h"
@implementation RNSVGRenderableManager
@@ -18,15 +17,17 @@ RCT_EXPORT_MODULE()
- (RNSVGRenderable *)node
{
- return [RNSVGRenderable new];
+ return [RNSVGRenderable new];
}
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(strokeLinecap, CGLineCap)
RCT_EXPORT_VIEW_PROPERTY(strokeLinejoin, CGLineJoin)
RCT_EXPORT_VIEW_PROPERTY(fill, RNSVGBrush)
-RCT_EXPORT_VIEW_PROPERTY(fillRule, RNSVGCGFillRule)
+RCT_EXPORT_VIEW_PROPERTY(fillRule, RNSVGCGFCRule)
RCT_EXPORT_VIEW_PROPERTY(stroke, CGColor)
RCT_EXPORT_VIEW_PROPERTY(strokeDash, RNSVGCGFloatArray)
+RCT_EXPORT_VIEW_PROPERTY(clipPath, CGPath)
+RCT_EXPORT_VIEW_PROPERTY(clipRule, RNSVGCGFCRule)
@end
diff --git a/ios/ViewManagers/RNSVGSvgViewManager.h b/ios/ViewManagers/RNSVGSvgViewManager.h
index f01a072a..700c8eb9 100644
--- a/ios/ViewManagers/RNSVGSvgViewManager.h
+++ b/ios/ViewManagers/RNSVGSvgViewManager.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RCTViewManager.h"
diff --git a/ios/ViewManagers/RNSVGSvgViewManager.m b/ios/ViewManagers/RNSVGSvgViewManager.m
index b0c1ba28..0b6a59f3 100644
--- a/ios/ViewManagers/RNSVGSvgViewManager.m
+++ b/ios/ViewManagers/RNSVGSvgViewManager.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGSvgViewManager.h"
diff --git a/ios/ViewManagers/RNSVGTextManager.h b/ios/ViewManagers/RNSVGTextManager.h
index 3c064b10..1885846b 100644
--- a/ios/ViewManagers/RNSVGTextManager.h
+++ b/ios/ViewManagers/RNSVGTextManager.h
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGRenderableManager.h"
diff --git a/ios/ViewManagers/RNSVGTextManager.m b/ios/ViewManagers/RNSVGTextManager.m
index 23c45a98..04500654 100644
--- a/ios/ViewManagers/RNSVGTextManager.m
+++ b/ios/ViewManagers/RNSVGTextManager.m
@@ -1,10 +1,9 @@
/**
- * Copyright (c) 2015-present, Facebook, Inc.
+ * Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT-style license found in the
+ * LICENSE file in the root directory of this source tree.
*/
#import "RNSVGTextManager.h"