This commit is contained in:
Niklas von Hertzen 2014-09-14 18:55:14 +03:00
parent 9907149513
commit b8d3688c29
2 changed files with 2 additions and 30 deletions

28
dist/html2canvas.js vendored
View File

@ -262,8 +262,6 @@ GradientContainer.prototype.TYPES = {
RADIAL: 2
};
GradientContainer.prototype.angleRegExp = /([+-]?\d*\.?\d+)(deg|grad|rad|turn)/;
function ImageContainer(src, cors) {
this.src = src;
this.image = new Image();
@ -447,32 +445,6 @@ function LinearGradientContainer(imageData) {
this.x1 = x0;
this.y1 = y0;
break;
default:
var angle = position.match(this.angleRegExp);
if (angle) {
switch(angle[2]) {
case "deg":
var angleDeg = parseFloat(angle[1]);
var radians = angleDeg / (180 / Math.PI);
var slope = Math.tan(radians); // m
var perpendicularSlope = -1 / slope;
// y = 2
// y = m * x
// 2 = m * x
this.y0 = 2 / Math.tan(slope) / 2; // 1
// console.log(radians, angle);
this.x0 = 0;
this.x1 = 1;
this.y1 = 0;
break;
}
}
}
}, this);
} else {

File diff suppressed because one or more lines are too long