finish basic Text features on iOS

This commit is contained in:
Horcrux
2016-09-17 17:14:31 +08:00
parent a37c3ceee6
commit 5f4ff90c2a
6 changed files with 33 additions and 46 deletions
+5 -1
View File
@@ -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];