mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Refactor background parsing
This commit is contained in:
@@ -17,7 +17,7 @@ _html2canvas.Renderer.Canvas = function(options) {
|
||||
}
|
||||
|
||||
function safeImage(item) {
|
||||
if (safeImages.indexOf(item['arguments'][0].src ) === -1) {
|
||||
if (safeImages.indexOf(item['arguments'][0].src) === -1) {
|
||||
testctx.drawImage(item['arguments'][0], 0, 0);
|
||||
try {
|
||||
testctx.getImageData(0, 0, 1, 1);
|
||||
@@ -42,8 +42,7 @@ _html2canvas.Renderer.Canvas = function(options) {
|
||||
if (item['arguments'][0].width > 0 && item['arguments'][0].height > 0) {
|
||||
try {
|
||||
ctx.fillStyle = ctx.createPattern(item['arguments'][0], "repeat");
|
||||
}
|
||||
catch(e) {
|
||||
} catch(e) {
|
||||
Util.log("html2canvas: Renderer: Error creating pattern", e.message);
|
||||
}
|
||||
}
|
||||
@@ -79,7 +78,6 @@ _html2canvas.Renderer.Canvas = function(options) {
|
||||
ctx.fillStyle = (Util.isTransparent(parsedData.backgroundColor) && options.background !== undefined) ? options.background : parsedData.backgroundColor;
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.fillStyle = fstyle;
|
||||
|
||||
queue.forEach(function(storageContext) {
|
||||
// set common settings for canvas
|
||||
ctx.textBaseline = "bottom";
|
||||
|
||||
Reference in New Issue
Block a user