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,5 +1,6 @@
import extractBrush from './extractBrush';
import extractOpacity from './extractOpacity';
import _ from 'lodash';
const fillRules = {
evenodd: 0,
@@ -8,7 +9,8 @@ const fillRules = {
export default function(props) {
return {
fill: extractBrush(props.fill),
// default fill is black
fill: extractBrush(_.isNil(props.fill) ? '#000' : props.fill),
fillOpacity: extractOpacity(props.fillOpacity),
fillRule: fillRules[props.fillRule] === 0 ? 0 : 1
};