fix rgba fill and stroke bug

This commit is contained in:
Horcrux
2016-06-10 23:33:18 +08:00
parent dba1fb2801
commit 239e1c928d
4 changed files with 14 additions and 13 deletions
+3 -6
View File
@@ -9,17 +9,14 @@ const fillRules = {
function fillFilter(props) {
let {fill} = props;
let fillOpacity = +props.fillOpacity;
if (fill === 'none') {
return null;
} else if (fill) {
return patterns(fill, +props.fillOpacity, props.svgId);
return patterns(fill, fillOpacity, props.svgId);
} else if (props.fill === undefined) {
let fillOpacity = +props.fillOpacity;
if (isNaN(fillOpacity)) {
fillOpacity = 1;
}
return rgba('#000', fillOpacity).rgbaString();
return rgba('#000', isNaN(fillOpacity) ? 1 : fillOpacity).rgbaString();
} else {
return null;
}