Skip to content

Commit 7e38df7

Browse files
don't generate gradient on invisible elements
1 parent 7f1cbc7 commit 7e38df7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Generate.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@
321321
};
322322

323323
_html2canvas.Generate.Gradient = function(src, bounds) {
324+
if(bounds.width === 0 || bounds.height === 0) {
325+
return;
326+
}
327+
324328
var canvas = document.createElement('canvas'),
325329
ctx = canvas.getContext('2d'),
326330
gradient, grad, i, len, img;

0 commit comments

Comments
 (0)