Skip to content

Commit ae8d499

Browse files
author
André Fiedler
committed
"small bugfix"
1 parent e479c95 commit ae8d499

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Generate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ _html2canvas.Generate.getColorStopsFromGradient = function(css, bounds) {
8080
m3 = m2[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%)?/);
8181
if(m3[2]){
8282
stop = parseFloat(m3[2]);
83-
if(m3[3]){ //percentage
83+
if(m3[3]){ // percentage
8484
stop /= 100;
8585
}
8686
} else {
@@ -115,7 +115,7 @@ _html2canvas.Generate.Gradient = function(src, bounds) {
115115

116116
img = new Image();
117117

118-
if(gradient){
118+
if(gradient && gradient.type === 'linear'){
119119
lingrad = ctx.createLinearGradient(gradient.x0, gradient.y0, gradient.x1, gradient.y1);
120120

121121
for (i = 0, len = gradient.colorStops.length; i < len; i+=1) {

0 commit comments

Comments
 (0)