fix image size detection on zero values. fix #774

This commit is contained in:
Anton Lavrenov
2019-12-24 11:20:44 -05:00
parent 42a5876d11
commit 76c0e3f272
4 changed files with 74 additions and 1334 deletions

View File

@@ -92,11 +92,11 @@ export class Image extends Shape<ImageConfig> {
}
getWidth() {
var image = this.image();
return this.attrs.width || (image ? image.width : 0);
return this.attrs.width ?? (image ? image.width : 0);
}
getHeight() {
var image = this.image();
return this.attrs.height || (image ? image.height : 0);
return this.attrs.height ?? (image ? image.height : 0);
}
/**