1717import android .view .View ;
1818import android .view .ViewGroup ;
1919
20- import com .facebook .react .uimanager .ReactShadowNode ;
21- import com .facebook .react .uimanager .annotations .ReactProp ;
22-
2320/**
2421 * Shadow node for virtual RNSVGGroup view
2522 */
2623public class RNSVGGroupShadowNode extends RNSVGVirtualNode {
2724
28- private String mAsClipPath = null ;
29-
30- @ ReactProp (name = "asClipPath" )
31- public void setAsClipPath (String asClipPath ) {
32- mAsClipPath = asClipPath ;
33- markUpdated ();
34- }
35-
3625 public void draw (Canvas canvas , Paint paint , float opacity ) {
3726 opacity *= mOpacity ;
3827 RNSVGSvgViewShadowNode svg = getSvgShadowNode ();
3928
40- if (mAsClipPath == null ) {
41- if (opacity > MIN_OPACITY_FOR_DRAW ) {
42- int count = saveAndSetupCanvas (canvas );
43- clip (canvas , paint );
29+ if (opacity > MIN_OPACITY_FOR_DRAW ) {
30+ int count = saveAndSetupCanvas (canvas );
31+ clip (canvas , paint );
4432
45- for (int i = 0 ; i < getChildCount (); i ++) {
46- RNSVGVirtualNode child = (RNSVGVirtualNode ) getChildAt (i );
47- child .setupDimensions (canvas );
48- child .draw (canvas , paint , opacity );
33+ for (int i = 0 ; i < getChildCount (); i ++) {
34+ RNSVGVirtualNode child = (RNSVGVirtualNode ) getChildAt (i );
35+ child .setupDimensions (canvas );
36+ child .draw (canvas , paint , opacity );
4937
50- if (child .isTouchable ()) {
51- svg .enableTouchEvents ();
52- }
38+ if (child .isTouchable ()) {
39+ svg .enableTouchEvents ();
5340 }
54-
55- restoreCanvas (canvas , count );
5641 }
5742
58- } else {
59- svg .defineClipPath (getPath (canvas , paint ), mAsClipPath );
43+ restoreCanvas (canvas , count );
6044 }
6145 }
6246
@@ -74,11 +58,6 @@ protected Path getPath(Canvas canvas, Paint paint) {
7458
7559 @ Override
7660 public int hitTest (Point point , View view ) {
77-
78- if (mAsClipPath != null ) {
79- return -1 ;
80- }
81-
8261 int viewTag = -1 ;
8362 for (int i = getChildCount () - 1 ; i >= 0 ; i --) {
8463 viewTag = ((RNSVGVirtualNode ) getChildAt (i )).hitTest (point , ((ViewGroup ) view ).getChildAt (i ));
0 commit comments