mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-31 21:58:01 +00:00
Add RenderableView, fix names. Allow percentages in nested SVG (iOS).
This commit is contained in:
@@ -125,8 +125,8 @@ abstract public class RenderableShadowNode extends VirtualNode {
|
||||
}
|
||||
|
||||
@ReactProp(name = "strokeDashoffset")
|
||||
public void setStrokeDashoffset(float strokeWidth) {
|
||||
mStrokeDashoffset = strokeWidth * mScale;
|
||||
public void setStrokeDashoffset(float strokeDashoffset) {
|
||||
mStrokeDashoffset = strokeDashoffset * mScale;
|
||||
markUpdated();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.horcrux.svg;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
|
||||
public class RenderableView extends ViewGroup {
|
||||
VirtualNode shadowNode;
|
||||
|
||||
public RenderableView(ReactContext reactContext) {
|
||||
super(reactContext);
|
||||
}
|
||||
|
||||
VirtualNode getShadowNode() {
|
||||
return shadowNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(int id) {
|
||||
super.setId(id);
|
||||
shadowNode = RenderableViewManager.getShadowNodeByTag(id);
|
||||
}
|
||||
|
||||
void dropView() {
|
||||
shadowNode = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -572,8 +572,8 @@ class RenderableViewManager extends ViewGroupManager<RenderableView> {
|
||||
}
|
||||
|
||||
@ReactProp(name = "fillOpacity", defaultFloat = 1f)
|
||||
public void setFillOpacity(RenderableView node, float opacity) {
|
||||
((RenderableShadowNode) node.getShadowNode()).setFillOpacity(opacity);
|
||||
public void setFillOpacity(RenderableView node, float fillOpacity) {
|
||||
((RenderableShadowNode) node.getShadowNode()).setFillOpacity(fillOpacity);
|
||||
}
|
||||
|
||||
@ReactProp(name = "fillRule", defaultInt = FILL_RULE_NONZERO)
|
||||
@@ -598,8 +598,8 @@ class RenderableViewManager extends ViewGroupManager<RenderableView> {
|
||||
}
|
||||
|
||||
@ReactProp(name = "strokeDashoffset")
|
||||
public void setStrokeDashoffset(RenderableView node, float strokeWidth) {
|
||||
((RenderableShadowNode) node.getShadowNode()).setStrokeDashoffset(strokeWidth);
|
||||
public void setStrokeDashoffset(RenderableView node, float strokeDashoffset) {
|
||||
((RenderableShadowNode) node.getShadowNode()).setStrokeDashoffset(strokeDashoffset);
|
||||
}
|
||||
|
||||
@ReactProp(name = "strokeWidth")
|
||||
|
||||
Reference in New Issue
Block a user