Browse Source

Properly clamp quality in toDataURL

v1.x
Zach Bjornson 9 years ago
parent
commit
d4b794561c
  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