mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 17:15:04 +00:00
Fix startOfRendering calculation. Fix cursor position calculation. Refactor extractStroke strokeWidth handling.
This commit is contained in:
@@ -26,7 +26,7 @@ export default function(props, styleProperties) {
|
||||
});
|
||||
|
||||
const {stroke} = props;
|
||||
const strokeWidth = props.strokeWidth;
|
||||
let strokeWidth = props.strokeWidth;
|
||||
let strokeDasharray = props.strokeDasharray;
|
||||
|
||||
if (!strokeDasharray || strokeDasharray === 'none') {
|
||||
@@ -43,14 +43,19 @@ export default function(props, styleProperties) {
|
||||
strokeDasharray.concat(strokeDasharray);
|
||||
}
|
||||
|
||||
if (!strokeWidth || typeof strokeWidth !== 'string') {
|
||||
strokeWidth = `${strokeWidth || 1}`;
|
||||
}
|
||||
|
||||
return {
|
||||
stroke: extractBrush(stroke),
|
||||
strokeOpacity: extractOpacity(props.strokeOpacity),
|
||||
strokeLinecap: caps[props.strokeLinecap] || 0,
|
||||
strokeLinejoin: joins[props.strokeLinejoin] || 0,
|
||||
strokeDasharray: strokeDasharray,
|
||||
strokeWidth: `${strokeWidth || 1}`,
|
||||
strokeWidth: strokeWidth,
|
||||
strokeDashoffset: strokeDasharray ? (+props.strokeDashoffset || 0) : null,
|
||||
strokeMiterlimit: props.strokeMiterlimit || 4
|
||||
strokeMiterlimit: props.strokeMiterlimit || 4,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user