mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
fix image size detection on zero values. fix #774
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user