mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-09 01:25:01 +00:00
finish basic Text features on iOS
This commit is contained in:
@@ -107,13 +107,14 @@ function parseText(props, inheritedProps = {}, deltas = []) {
|
||||
|
||||
|
||||
if (typeof children === 'string') {
|
||||
|
||||
let computedProps = _.reduce(inheritedProps, (prev, value, name) => {
|
||||
if (!prev.hasOwnProperty(name)) {
|
||||
prev[name] = value;
|
||||
}
|
||||
|
||||
return prev;
|
||||
}, _.omit(props, ['children', 'x', 'y']));
|
||||
}, _.pick(props, fontAndRenderPropsKeys));
|
||||
|
||||
let delta = deltas.shift();
|
||||
|
||||
@@ -135,6 +136,8 @@ function parseText(props, inheritedProps = {}, deltas = []) {
|
||||
positionY: y || null
|
||||
});
|
||||
|
||||
x = y = null;
|
||||
|
||||
if (!text) {
|
||||
return spanArray;
|
||||
} else {
|
||||
@@ -143,6 +146,7 @@ function parseText(props, inheritedProps = {}, deltas = []) {
|
||||
};
|
||||
|
||||
} else {
|
||||
inheritedProps = _.assign({}, inheritedProps);
|
||||
fontAndRenderPropsKeys.forEach(inheritablePropName => {
|
||||
if (props.hasOwnProperty(inheritablePropName)) {
|
||||
inheritedProps[inheritablePropName] = props[inheritablePropName];
|
||||
|
||||
Reference in New Issue
Block a user