mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-25 12:03:27 +00:00
[android] Fix caching of text
This commit is contained in:
@@ -65,6 +65,7 @@ class TSpanShadowNode extends TextShadowNode {
|
||||
@Override
|
||||
protected void releaseCachedPath() {
|
||||
mCache = null;
|
||||
mPath = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,6 +35,12 @@ class TextShadowNode extends GroupShadowNode {
|
||||
private @Nullable ReadableArray mDeltaX;
|
||||
private @Nullable ReadableArray mDeltaY;
|
||||
|
||||
@Override
|
||||
public void markUpdated() {
|
||||
super.markUpdated();
|
||||
releaseCachedPath();
|
||||
}
|
||||
|
||||
@ReactProp(name = "textLength")
|
||||
public void setTextLength(@Nullable String length) {
|
||||
mTextLength = length;
|
||||
@@ -124,7 +130,6 @@ class TextShadowNode extends GroupShadowNode {
|
||||
clip(canvas, paint);
|
||||
getGroupPath(canvas, paint);
|
||||
drawGroup(canvas, paint, opacity);
|
||||
releaseCachedPath();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +137,6 @@ class TextShadowNode extends GroupShadowNode {
|
||||
protected Path getPath(Canvas canvas, Paint paint) {
|
||||
setupGlyphContext(canvas);
|
||||
Path groupPath = getGroupPath(canvas, paint);
|
||||
releaseCachedPath();
|
||||
return groupPath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user