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

@@ -1,7 +1,8 @@
import React, {Component, PropTypes} from 'react';
import ViewBox from './ViewBox';
import Defs from './Defs';
import G from './G';
class SymbolElement extends Component{
static displayName = 'Symbol';
static propType = {
@@ -9,10 +10,8 @@ class SymbolElement extends Component{
};
render() {
let {props} = this;
return <Defs.Item
id={props.id}
svgId={props.svgId}
>
return <G id={props.id}>
<ViewBox
{...props}
viewbox={props.viewbox}
@@ -20,7 +19,7 @@ class SymbolElement extends Component{
>
{props.children}
</ViewBox>
</Defs.Item>;
</G>;
}
}