mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 06:31:15 +08:00
Revert to previous no-parameter (image/png) behavior if an exception is
encountered while calling canvas toDataURL() with parameters. See this forum post: http://www.kineticjs.com/forum/viewtopic.php?f=10&t=423
This commit is contained in:
parent
98917fe644
commit
96659d7299
10
src/Stage.js
10
src/Stage.js
@ -161,7 +161,15 @@ Kinetic.Stage.prototype = {
|
||||
addLayer(n);
|
||||
}
|
||||
else {
|
||||
callback(bufferLayer.getCanvas().toDataURL(mimeType, quality));
|
||||
try {
|
||||
// If this call fails (due to browser bug, like in Firefox 3.6),
|
||||
// then revert to previous no-parameter image/png behavior
|
||||
callback(bufferLayer.getCanvas().toDataURL(mimeType, quality));
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
callback(bufferLayer.getCanvas().toDataURL());
|
||||
}
|
||||
}
|
||||
};
|
||||
imageObj.src = dataURL;
|
||||
|
Loading…
Reference in New Issue
Block a user