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