Browse Source

Return no canvas data string synchronously for backwards compatibility

master
Luke Childs 8 years ago
parent
commit
818a26a43a
  1. 6
      lib/canvas.js

6
lib/canvas.js

@ -261,13 +261,13 @@ Canvas.prototype.toDataURL = function(a1, a2, a3){
if (this.width === 0 || this.height === 0) {
// Per spec, if the bitmap has no pixels, return this string:
var str = "data:,";
if (fn) {
setTimeout(function() {
fn(null, "data:,");
fn(null, str);
});
return;
}
return "data:,";
return str;
}
if ('image/png' === type) {

Loading…
Cancel
Save