Fix handling of react-native style transform arrays on root Svg element

Simplify urlIdPattern
This commit is contained in:
Mikael Sand
2019-02-02 15:57:11 +02:00
parent 4f1b70d9b8
commit a2d420c7e8
2 changed files with 12 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import extractColor from './extractColor';
const urlIdPattern = /^url\(#(.+?)\)$/;
const urlIdPattern = /^url\(#(.+)\)$/;
const currentColorBrush = [2];
+11 -8
View File
@@ -23,14 +23,17 @@ export function transformToMatrix(props, transform) {
if (transform) {
if (Array.isArray(transform)) {
pooledMatrix.append(
transform[0],
transform[1],
transform[2],
transform[3],
transform[4],
transform[5],
);
if (typeof transform[0] === 'number') {
pooledMatrix.append(
transform[0],
transform[1],
transform[2],
transform[3],
transform[4],
transform[5],
);
}
// noop for react-native transform arrays, let animated handle them
} else if (typeof transform === 'string') {
try {
const t = transformParser.parse(transform);