mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-07 00:42:31 +00:00
Fix parsing of generic units in dx and dy, and percentages in rotate text attributes.
This commit is contained in:
@@ -77,14 +77,7 @@ export function extractFont(props) {
|
||||
|
||||
function parseDelta(delta) {
|
||||
if (typeof delta === 'string') {
|
||||
const trim = delta.trim();
|
||||
if (trim.slice(-2) === 'em') {
|
||||
return [trim];
|
||||
} else if (isNaN(+delta)) {
|
||||
return trim.replace(commaReg, ' ').split(spaceReg).map(d => +d || 0);
|
||||
} else {
|
||||
return [+delta];
|
||||
}
|
||||
return delta.trim().replace(commaReg, ' ').split(spaceReg);
|
||||
} else if (typeof delta === 'number') {
|
||||
return [delta];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user