fix: #1262 support single dimension + aspectRatio syntax

This commit is contained in:
Mikael Sand
2020-03-05 13:02:35 +02:00
parent 0362f44b8c
commit b2f7605855
+6 -3
View File
@@ -116,10 +116,10 @@ export default class Svg extends Shape<
...(Array.isArray(style) ? Object.assign({}, ...style) : style),
...extracted,
};
const {
let {
color,
width = '100%',
height = '100%',
width,
height,
focusable,
// Inherited G properties
@@ -137,6 +137,9 @@ export default class Svg extends Shape<
strokeLinejoin,
strokeMiterlimit,
} = stylesAndProps;
if (width === undefined && height === undefined) {
width = height = '100%';
}
const props: extractedProps = extracted as extractedProps;
props.focusable = Boolean(focusable) && focusable !== 'false';