mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 22:05:14 +00:00
refactor text render
Support G inherit props. Refactor text render. Text glyphs will perfectly draw along the path
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user