File tree Expand file tree Collapse file tree 5 files changed +10
-20
lines changed
android/src/main/java/com/horcrux/svg Expand file tree Collapse file tree 5 files changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,7 @@ public void setResponsible(boolean responsible) {
334
334
Path clipPath = mClipNode .mClipRule == CLIP_RULE_EVENODD ? mClipNode .getPath (canvas , paint ) :
335
335
mClipNode .getPath (canvas , paint , Region .Op .UNION );
336
336
clipPath .transform (mClipNode .mMatrix );
337
+ clipPath .transform (mClipNode .mTransform );
337
338
switch (mClipNode .mClipRule ) {
338
339
case CLIP_RULE_EVENODD :
339
340
clipPath .setFillType (Path .FillType .EVEN_ODD );
Original file line number Diff line number Diff line change @@ -314,7 +314,7 @@ - (CGPathRef)getClipPath:(CGContextRef)context
314
314
if (_cachedClipPath) {
315
315
CGPathRelease (_cachedClipPath);
316
316
}
317
- CGAffineTransform transform = _clipNode.matrix ;
317
+ CGAffineTransform transform = CGAffineTransformConcat ( _clipNode.matrix , _clipNode. transforms ) ;
318
318
_cachedClipPath = CGPathCreateCopyByTransformingPath ([_clipNode getPath: context], &transform);
319
319
CGPathRetain (_cachedClipPath);
320
320
if (_clipMask) {
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { requireNativeComponent } from 'react-native' ;
3
- import extractClipPath from '../lib/extract/extractClipPath' ;
4
- import { TransformProps } from '../lib/extract/types' ;
3
+ import extractProps , { propsAndStyles } from '../lib/extract/extractProps' ;
5
4
import Shape from './Shape' ;
6
5
7
- export default class ClipPath extends Shape < {
8
- id ?: string ;
9
- clipPath ?: string ;
10
- clipRule ?: 'evenodd' | 'nonzero' ;
11
- transform ?: number [ ] | string | TransformProps ;
12
- } > {
6
+ export default class ClipPath extends Shape < { } > {
13
7
static displayName = 'ClipPath' ;
14
8
15
9
render ( ) {
16
10
const { props } = this ;
17
- const { id, children } = props ;
18
11
return (
19
- < RNSVGClipPath ref = { this . refMethod } name = { id } { ...extractClipPath ( props ) } >
20
- { children }
12
+ < RNSVGClipPath
13
+ ref = { this . refMethod }
14
+ { ...extractProps ( propsAndStyles ( props ) , this ) }
15
+ >
16
+ { props . children }
21
17
</ RNSVGClipPath >
22
18
) ;
23
19
}
Original file line number Diff line number Diff line change 1
1
import { idPattern } from '../util' ;
2
2
import { ClipProps } from './types' ;
3
- import extractTransform from './extractTransform' ;
4
3
5
4
const clipRules : { evenodd : number ; nonzero : number } = {
6
5
evenodd : 0 ,
7
6
nonzero : 1 ,
8
7
} ;
9
8
10
9
export default function extractClipPath ( props : ClipProps ) {
11
- const { clipPath, clipRule, transform } = props ;
10
+ const { clipPath, clipRule } = props ;
12
11
const extracted : {
13
12
clipPath ?: string ;
14
13
clipRule ?: number ;
15
- matrix ?: number [ ] ;
16
14
} = { } ;
17
15
18
16
if ( clipRule ) {
@@ -33,9 +31,5 @@ export default function extractClipPath(props: ClipProps) {
33
31
}
34
32
}
35
33
36
- if ( transform ) {
37
- extracted . matrix = extractTransform ( transform ) ;
38
- }
39
-
40
34
return extracted ;
41
35
}
Original file line number Diff line number Diff line change @@ -92,5 +92,4 @@ export type StrokeProps = {
92
92
export type ClipProps = {
93
93
clipPath ?: string ;
94
94
clipRule ?: 'evenodd' | 'nonzero' ;
95
- transform ?: number [ ] | string | TransformProps ;
96
95
} ;
You can’t perform that action at this time.
0 commit comments