mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 23:16:13 +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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user