5211b26903
* update deps * update patches * fix new arch optout * build from source, disable new arch * update to preview.14 * upgrade off of preview to release * fix lockfile lint * update patches * add back expo-location * downgrade reanimated * downgrade pagerview * use expo-file-system/legacy * try and upgrade types/react-dom * fix type of uint8array * rm @types/react resolution from bad rebase * more type errors * fix mock * bump rn-compressor * add patch of https://github.com/bluesky-social/react-native-paste-input/pull/5 * delete NativeDropdown & remove Zeego * `import React` in expo modules * bump cocoapods * rm unused picker lib * add speculative react-native-mmkv patch * revert patch, add temp debug info to error * bring back speculative patch, patch built JS code instead of source * revert patch, just do debugging part * dep update * update resolutions, dynamic-app-icon * bump node version in eas.json * update build instructions * rm atob from docs * Delete react-native-mmkv+2.12.2.patch * bump expo which might include fix * update expo patch version * bump expo patch version * wrong version oops * update expo to latest * update react-native-compressor, rm patch
58 lines
1.7 KiB
Diff
58 lines
1.7 KiB
Diff
diff --git a/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/PathView.java b/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/PathView.java
|
|
index 06829bd..1b15818 100644
|
|
--- a/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/PathView.java
|
|
+++ b/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/PathView.java
|
|
@@ -14,17 +14,33 @@ import android.graphics.Paint;
|
|
import android.graphics.Path;
|
|
import com.facebook.react.bridge.ReactContext;
|
|
|
|
+import java.util.ArrayList;
|
|
+import java.util.HashMap;
|
|
+
|
|
+class ParsedPath {
|
|
+ final Path path;
|
|
+ final ArrayList<PathElement> elements;
|
|
+
|
|
+ ParsedPath(Path path, ArrayList<PathElement> elements) {
|
|
+ this.path = path;
|
|
+ this.elements = elements;
|
|
+ }
|
|
+}
|
|
+
|
|
@SuppressLint("ViewConstructor")
|
|
class PathView extends RenderableView {
|
|
private Path mPath;
|
|
|
|
+ // This grows forever but for our use case (static icons) it's ok.
|
|
+ private static final HashMap<String, ParsedPath> sPathCache = new HashMap<>();
|
|
+
|
|
public PathView(ReactContext reactContext) {
|
|
super(reactContext);
|
|
PathParser.mScale = mScale;
|
|
mPath = new Path();
|
|
}
|
|
|
|
- public void setD(String d) {
|
|
+ void setDByParsing(String d) {
|
|
mPath = PathParser.parse(d);
|
|
elements = PathParser.elements;
|
|
for (PathElement elem : elements) {
|
|
@@ -33,6 +49,17 @@ class PathView extends RenderableView {
|
|
point.y *= mScale;
|
|
}
|
|
}
|
|
+ }
|
|
+
|
|
+ public void setD(String d) {
|
|
+ ParsedPath cached = sPathCache.get(d);
|
|
+ if (cached != null) {
|
|
+ mPath = cached.path;
|
|
+ elements = cached.elements;
|
|
+ } else {
|
|
+ setDByParsing(d);
|
|
+ sPathCache.put(d, new ParsedPath(mPath, elements));
|
|
+ }
|
|
invalidate();
|
|
}
|
|
|