mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-23 11:16:42 +00:00
Fix ClipPath position with Text elements
This commit is contained in:
@@ -16,5 +16,6 @@
|
||||
@interface RNSVGGroup : RNSVGPath <RNSVGContainer>
|
||||
|
||||
- (void)pathRenderLayerTo:(CGContextRef)contex;
|
||||
- (void)renderLayerToWithTransform:(CGContextRef)context transform:(CGAffineTransform)transform;
|
||||
|
||||
@end
|
||||
|
||||
@@ -11,9 +11,16 @@
|
||||
@implementation RNSVGGroup
|
||||
|
||||
- (void)renderLayerTo:(CGContextRef)context
|
||||
{
|
||||
[self renderLayerToWithTransform:context transform:CGAffineTransformIdentity];
|
||||
}
|
||||
|
||||
- (void)renderLayerToWithTransform:(CGContextRef)context transform:(CGAffineTransform)transform
|
||||
{
|
||||
RNSVGSvgView* svg = [self getSvgView];
|
||||
[self clip:context];
|
||||
|
||||
CGContextConcatCTM(context, transform);
|
||||
[self traverseSubviews:^(RNSVGNode *node) {
|
||||
if (node.responsible && !svg.responsible) {
|
||||
svg.responsible = YES;
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
- (void)renderLayerTo:(CGContextRef)context
|
||||
{
|
||||
CGContextSaveGState(context);
|
||||
CGContextConcatCTM(context, CGAffineTransformMakeTranslation([self getShift:context path:nil], 0));
|
||||
[super renderLayerTo:context];
|
||||
CGAffineTransform transform = CGAffineTransformMakeTranslation([self getShift:context path:nil], 0);
|
||||
[super renderLayerToWithTransform:context transform:transform];
|
||||
CGContextRestoreGState(context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user