bug fixes for body background & firefox font

This commit is contained in:
Niklas von Hertzen
2012-03-02 14:43:25 +02:00
parent 2dc8b9385e
commit bf994849e0
3 changed files with 12 additions and 4 deletions

View File

@ -286,9 +286,13 @@ html2canvas.Parse = function (element, images, opts) {
}
ctx.setVariable("fillStyle", color);
ctx.setVariable("font", font_variant + " " + bold + " " + font_style + " " + size + " " + family);
/*
need to be defined in the order as defined in http://www.w3.org/TR/CSS21/fonts.html#font-shorthand
to properly work in Firefox
*/
ctx.setVariable("font", font_style+ " " + font_variant + " " + bold + " " + size + " " + family);
if (align){
ctx.setVariable("textAlign", "right");
}else{
@ -1260,6 +1264,9 @@ html2canvas.Parse = function (element, images, opts) {
parseElement(children[i], stack);
}
stack.backgroundColor = getCSS( body, "backgroundColor" );
return stack;
};

View File

@ -94,7 +94,7 @@ html2canvas.Renderer = function(parseQueue, opts){
canvas.height = canvas.style.height = (!usingFlashcanvas) ? options.height || zStack.ctx.height : Math.min(flashMaxSize, (options.height || zStack.ctx.height) );
fstyle = ctx.fillStyle;
ctx.fillStyle = "#fff";
ctx.fillStyle = zStack.backgroundColor;
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = fstyle;