Browse Source

Merge pull request #728 from zbjornson/master

Properly clamp quality in toDataURL
v1.x
Linus Unnebäck 9 years ago
parent
commit
b2a71a8687
  1. 2
      lib/canvas.js

2
lib/canvas.js

@ -232,7 +232,7 @@ Canvas.prototype.toDataURL = function(a1, a2, a3){
if ('object' === typeof a2) {
opts = a2;
} else if ('number' === typeof a2) {
opts = {quality: Math.min(0, Math.max(1, a2)) * 100};
opts = {quality: Math.max(0, Math.min(1, a2)) * 100};
}
if ('function' === typeof a3) {

Loading…
Cancel
Save