mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-02 23:02:16 +00:00
fix memory leak issue with CGMutablePathRef
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import extractBrush from './extractBrush';
|
||||
import extractOpacity from './extractOpacity';
|
||||
import _ from 'lodash';
|
||||
let separator = /\s*,\s*/;
|
||||
|
||||
const caps = {
|
||||
@@ -15,12 +16,19 @@ const joins = {
|
||||
};
|
||||
|
||||
export default function(props) {
|
||||
let strokeWidth = +props.strokeWidth;
|
||||
let {stroke} = props;
|
||||
if (!strokeWidth && !stroke) {
|
||||
if (!stroke) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let strokeWidth = +props.strokeWidth;
|
||||
|
||||
if (_.isNil(props.strokeWidth)) {
|
||||
strokeWidth = 1;
|
||||
} else if (!strokeWidth) {
|
||||
return;
|
||||
}
|
||||
|
||||
let strokeDasharray = props.strokeDasharray;
|
||||
|
||||
if (typeof strokeDasharray === 'string') {
|
||||
@@ -42,7 +50,7 @@ export default function(props) {
|
||||
strokeLinecap: caps[props.strokeLinecap] || 0,
|
||||
strokeLinejoin: joins[props.strokeLinejoin] || 0,
|
||||
strokeDasharray: strokeDasharray || null,
|
||||
strokeWidth: strokeWidth || 1,
|
||||
strokeWidth: strokeWidth,
|
||||
strokeDashoffset: strokeDasharray ? (+props.strokeDashoffset || 0) : null,
|
||||
strokeMiterlimit: props.strokeMiterlimit || 4
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user