none flex layout use actual dimensions as width and height set

This commit is contained in:
Horcrux
2016-04-29 23:25:28 +08:00
parent 5008457ba6
commit bc6982518e
+3 -2
View File
@@ -62,7 +62,7 @@ class Svg extends Component{
let opacity = +props.opacity; let opacity = +props.opacity;
let width = +props.width; let width = +props.width;
let height = +props.height; let height = +props.height;
let flexLayout = !isNaN(width) || !isNaN(height); let flexLayout = isNaN(width) || isNaN(height);
let content = (props.viewbox && !flexLayout) ? <ViewBox let content = (props.viewbox && !flexLayout) ? <ViewBox
viewbox={props.viewbox} viewbox={props.viewbox}
@@ -83,7 +83,8 @@ class Svg extends Component{
}, },
!flexLayout && { !flexLayout && {
width, width,
height height,
flex: 0
} }
]} ]}
> >