mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-24 19:48:46 +00:00
Organize import, fix stale width and height cache.
This commit is contained in:
@@ -10,10 +10,8 @@
|
||||
package com.horcrux.svg;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.RectF;
|
||||
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
|
||||
@@ -9,19 +9,12 @@
|
||||
|
||||
package com.horcrux.svg;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.DashPathEffect;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Region;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
|
||||
@@ -34,7 +27,8 @@ import java.util.ArrayList;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static android.content.ContentValues.TAG;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Renderable shadow node
|
||||
|
||||
@@ -49,7 +49,6 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
||||
private String mbbHeight;
|
||||
private String mAlign;
|
||||
private int mMeetOrSlice;
|
||||
private Matrix mViewBoxMatrix = new Matrix();
|
||||
private Matrix mInvViewBoxMatrix = new Matrix();
|
||||
private boolean mInvertible = true;
|
||||
|
||||
@@ -156,7 +155,7 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
||||
if (nested) {
|
||||
canvas.clipRect(eRect);
|
||||
}
|
||||
mViewBoxMatrix = ViewBox.getTransform(vbRect, eRect, mAlign, mMeetOrSlice);
|
||||
Matrix mViewBoxMatrix = ViewBox.getTransform(vbRect, eRect, mAlign, mMeetOrSlice);
|
||||
mInvertible = mViewBoxMatrix.invert(mInvViewBoxMatrix);
|
||||
canvas.concat(mViewBoxMatrix);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Region;
|
||||
|
||||
@@ -90,6 +89,8 @@ abstract class VirtualNode extends LayoutShadowNode {
|
||||
@Override
|
||||
public void markUpdated() {
|
||||
super.markUpdated();
|
||||
canvasHeight = -1;
|
||||
canvasWidth = -1;
|
||||
mRegion = null;
|
||||
mPath = null;
|
||||
mBox = null;
|
||||
|
||||
Reference in New Issue
Block a user