12
12
import android .graphics .Matrix ;
13
13
14
14
import com .facebook .common .logging .FLog ;
15
+ import com .facebook .react .bridge .Dynamic ;
15
16
import com .facebook .react .bridge .ReadableArray ;
17
+ import com .facebook .react .bridge .ReadableType ;
16
18
import com .facebook .react .common .ReactConstants ;
17
19
import com .facebook .react .uimanager .annotations .ReactProp ;
18
20
@@ -38,26 +40,42 @@ class MaskShadowNode extends GroupShadowNode {
38
40
private Matrix mMatrix = null ;
39
41
40
42
@ ReactProp (name = "x" )
41
- public void setX (String x ) {
42
- mX = x ;
43
+ public void setX (Dynamic x ) {
44
+ if (x .getType () == ReadableType .String ) {
45
+ mX = x .asString ();
46
+ } else {
47
+ mX = String .valueOf (x .asDouble ());
48
+ }
43
49
markUpdated ();
44
50
}
45
51
46
52
@ ReactProp (name = "y" )
47
- public void setY (String y ) {
48
- mY = y ;
53
+ public void setY (Dynamic y ) {
54
+ if (y .getType () == ReadableType .String ) {
55
+ mY = y .asString ();
56
+ } else {
57
+ mY = String .valueOf (y .asDouble ());
58
+ }
49
59
markUpdated ();
50
60
}
51
61
52
- @ ReactProp (name = "maskwidth" )
53
- public void setWidth (String width ) {
54
- mWidth = width ;
62
+ @ ReactProp (name = "width" )
63
+ public void setWidth (Dynamic width ) {
64
+ if (width .getType () == ReadableType .String ) {
65
+ mWidth = width .asString ();
66
+ } else {
67
+ mWidth = String .valueOf (width .asDouble ());
68
+ }
55
69
markUpdated ();
56
70
}
57
71
58
- @ ReactProp (name = "maskheight" )
59
- public void setHeight (String height ) {
60
- mHeight = height ;
72
+ @ ReactProp (name = "height" )
73
+ public void setHeight (Dynamic height ) {
74
+ if (height .getType () == ReadableType .String ) {
75
+ mHeight = height .asString ();
76
+ } else {
77
+ mHeight = String .valueOf (height .asDouble ());
78
+ }
61
79
markUpdated ();
62
80
}
63
81
0 commit comments