mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-22 23:25:20 +00:00
refactor shape elements add responder system.
refactor shape elements add responder system. Just iOS.
This commit is contained in:
@@ -2,14 +2,16 @@ import extractFill from './extractFill';
|
||||
import extractStroke from './extractStroke';
|
||||
import extractTransform from './extractTransform';
|
||||
import extractClipping from './extractClipping';
|
||||
import extractResponder from './extractResponder';
|
||||
import _ from 'lodash';
|
||||
|
||||
export default function(props, options = {stroke: true, transform: true, fill: true}) {
|
||||
export default function(props, options = {stroke: true, transform: true, fill: true, responder: true}) {
|
||||
if (props.visible === false) {
|
||||
return {
|
||||
opacity: 0
|
||||
};
|
||||
}
|
||||
|
||||
let extractedProps = {
|
||||
opacity: +props.opacity || 1
|
||||
};
|
||||
@@ -30,5 +32,9 @@ export default function(props, options = {stroke: true, transform: true, fill: t
|
||||
extractedProps.transform = extractTransform(props);
|
||||
}
|
||||
|
||||
if (options.responder) {
|
||||
_.assign(extractedProps, extractResponder(props));
|
||||
}
|
||||
|
||||
return extractedProps;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user