mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-31 13:52:58 +00:00
Stroke dash as ios do
This commit is contained in:
@@ -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
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"name": "react-native-svg",
|
||||
"description": "react native svg library",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user