mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 05:55:10 +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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user