refactor text render

Support G inherit props.
Refactor text render. Text glyphs will perfectly draw along the path
This commit is contained in:
Horcrux
2016-07-22 23:49:15 +08:00
parent 63f793c54e
commit 7e13b801e1
41 changed files with 467 additions and 477 deletions

View File

@@ -4,11 +4,29 @@ import extractTransform from './extractTransform';
import extractClipping from './extractClipping';
import extractResponder from './extractResponder';
import extractOpacity from './extractOpacity';
import {RenderableOnlyAttributes} from '../attributes';
import _ from 'lodash';
export default function(props, options = {stroke: true, transform: true, fill: true, responder: true}) {
let propList = [];
Object.keys(RenderableOnlyAttributes).forEach(name => {
if (!_.isNil(props[name])) {
// clipPath prop may provide `clipPathRef` as native prop
if (name === 'clipPath') {
if (extractedProps[name]) {
propList.push(name);
} else if (extractedProps.clipPathRef) {
propList.push('clipPathRef');
}
} else {
propList.push(name);
}
}
});
let extractedProps = {
opacity: extractOpacity(props.opacity)
opacity: extractOpacity(props.opacity),
propList
};
if (props.id) {