Fix fail on transparent colors in linear gradients

This commit is contained in:
MoyuScript 2015-03-01 17:43:18 +02:00
parent 1e3b9d5aff
commit 088dcb401d
3 changed files with 3 additions and 3 deletions

2
dist/html2canvas.js vendored
View File

@ -2440,7 +2440,7 @@ function LinearGradientContainer(imageData) {
}
this.colorStops = imageData.args.slice(hasDirection ? 1 : 0).map(function(colorStop) {
var colorStopMatch = colorStop.match(this.stepRegExp);
var colorStopMatch = colorStop.replace(/transparent/g, 'rgba(0, 0, 0, 0.0)').match(this.stepRegExp);
return {
color: new Color(colorStopMatch[1]),
stop: colorStopMatch[3] === "%" ? colorStopMatch[2] / 100 : null

File diff suppressed because one or more lines are too long

View File

@ -42,7 +42,7 @@ function LinearGradientContainer(imageData) {
}
this.colorStops = imageData.args.slice(hasDirection ? 1 : 0).map(function(colorStop) {
var colorStopMatch = colorStop.match(this.stepRegExp);
var colorStopMatch = colorStop.replace(/transparent/g, 'rgba(0, 0, 0, 0.0)').match(this.stepRegExp);
return {
color: new Color(colorStopMatch[1]),
stop: colorStopMatch[3] === "%" ? colorStopMatch[2] / 100 : null