Stroke dash as ios do

This commit is contained in:
Horcrux
2016-04-23 22:02:57 +08:00
parent 2beb0af456
commit 5e32544e22
2 changed files with 8 additions and 2 deletions
@@ -87,13 +87,19 @@ public class RNSVGPathShadowNode extends RNSVGVirtualNode {
@ReactProp(name = "strokeDasharray")
public void setStrokeDash(@Nullable ReadableArray strokeDasharray) {
mStrokeDasharray = PropHelper.toFloatArray(strokeDasharray);
if (mStrokeDasharray != null && mStrokeDasharray.length > 0) {
for (int i = 0; i < mStrokeDasharray.length; i++) {
mStrokeDasharray[i] = mStrokeDasharray[i] * mScale;
}
}
markUpdated();
}
@ReactProp(name = "strokeDashoffset", defaultFloat = 0f)
public void setStrokeDashoffset(float strokeWidth) {
mStrokeDashoffset = strokeWidth;
mStrokeDashoffset = strokeWidth * mScale;
markUpdated();
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.1.1",
"name": "react-native-svg",
"description": "react native svg library",
"repository": {