mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 05:10:26 +08:00
Merge pull request #10 from jfollas/master
Workaround for older browser security exception using toDataURL() with parameters
This commit is contained in:
commit
6889cd742c
@ -161,8 +161,16 @@ Kinetic.Stage.prototype = {
|
||||
addLayer(n);
|
||||
}
|
||||
else {
|
||||
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