mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 16:04:38 +00:00
[android] Cache group paths.
This commit is contained in:
@@ -126,18 +126,21 @@ class GroupView extends RenderableView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
Path getPath(final Canvas canvas, final Paint paint) {
|
Path getPath(final Canvas canvas, final Paint paint) {
|
||||||
final Path path = new Path();
|
if (mPath != null) {
|
||||||
|
return mPath;
|
||||||
|
}
|
||||||
|
mPath = new Path();
|
||||||
|
|
||||||
for (int i = 0; i < getChildCount(); i++) {
|
for (int i = 0; i < getChildCount(); i++) {
|
||||||
View node = getChildAt(i);
|
View node = getChildAt(i);
|
||||||
if (node instanceof VirtualView) {
|
if (node instanceof VirtualView) {
|
||||||
VirtualView n = (VirtualView)node;
|
VirtualView n = (VirtualView)node;
|
||||||
Matrix transform = n.mMatrix;
|
Matrix transform = n.mMatrix;
|
||||||
path.addPath(n.getPath(canvas, paint), transform);
|
mPath.addPath(n.getPath(canvas, paint), transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return mPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
Path getPath(final Canvas canvas, final Paint paint, final Region.Op op) {
|
Path getPath(final Canvas canvas, final Paint paint, final Region.Op op) {
|
||||||
|
|||||||
Reference in New Issue
Block a user