mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fix fail on transparent colors in linear gradients
This commit is contained in:
parent
d9a9615ed7
commit
c2baf42145
2
dist/html2canvas.js
vendored
2
dist/html2canvas.js
vendored
@ -2440,7 +2440,7 @@ function LinearGradientContainer(imageData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.colorStops = imageData.args.slice(hasDirection ? 1 : 0).map(function(colorStop) {
|
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 {
|
return {
|
||||||
color: new Color(colorStopMatch[1]),
|
color: new Color(colorStopMatch[1]),
|
||||||
stop: colorStopMatch[3] === "%" ? colorStopMatch[2] / 100 : null
|
stop: colorStopMatch[3] === "%" ? colorStopMatch[2] / 100 : null
|
||||||
|
2
dist/html2canvas.min.js
vendored
2
dist/html2canvas.min.js
vendored
File diff suppressed because one or more lines are too long
@ -42,7 +42,7 @@ function LinearGradientContainer(imageData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.colorStops = imageData.args.slice(hasDirection ? 1 : 0).map(function(colorStop) {
|
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 {
|
return {
|
||||||
color: new Color(colorStopMatch[1]),
|
color: new Color(colorStopMatch[1]),
|
||||||
stop: colorStopMatch[3] === "%" ? colorStopMatch[2] / 100 : null
|
stop: colorStopMatch[3] === "%" ? colorStopMatch[2] / 100 : null
|
||||||
|
Loading…
Reference in New Issue
Block a user