mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 15:14:18 +00:00
Merge remote-tracking branch 'Fitzpasd/remove_stop_check'
This commit is contained in:
@@ -15,20 +15,14 @@ export default function(props) {
|
|||||||
|
|
||||||
const stops = {};
|
const stops = {};
|
||||||
Children.forEach(props.children, child => {
|
Children.forEach(props.children, child => {
|
||||||
if (child.type === Stop) {
|
if (child.props.stopColor && child.props.offset) {
|
||||||
if (child.props.stopColor && child.props.offset) {
|
// convert percent to float.
|
||||||
// convert percent to float.
|
let offset = percentToFloat(child.props.offset);
|
||||||
let offset = percentToFloat(child.props.offset);
|
|
||||||
|
|
||||||
// add stop
|
// add stop
|
||||||
//noinspection JSUnresolvedFunction
|
//noinspection JSUnresolvedFunction
|
||||||
stops[offset] = Color(child.props.stopColor).alpha(
|
stops[offset] = Color(child.props.stopColor).alpha(
|
||||||
extractOpacity(child.props.stopOpacity)
|
extractOpacity(child.props.stopOpacity)
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.warn(
|
|
||||||
"`Gradient` elements only accept `Stop` elements as children"
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user