mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
added warning check for toDataURL, and also improved image buffer unit tests
This commit is contained in:
@@ -162,7 +162,7 @@ Kinetic.Image.prototype = {
|
||||
});
|
||||
}
|
||||
catch(e) {
|
||||
Kinetic.Global.warn('Unable to create image buffer.');
|
||||
Kinetic.Global.warn('Unable to create image buffer. ' + e.message);
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
@@ -93,7 +93,13 @@ Kinetic.Canvas.prototype = {
|
||||
return this.element.toDataURL(mimeType, quality);
|
||||
}
|
||||
catch(e) {
|
||||
return this.element.toDataURL();
|
||||
try {
|
||||
return this.element.toDataURL();
|
||||
}
|
||||
catch(e) {
|
||||
Kinetic.Global.warn('Unable to get data URL. ' + e.message)
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user