Index: excanvas.js =================================================================== --- excanvas.js (revision 63) +++ excanvas.js (working copy) @@ -255,6 +255,7 @@ o2.arcScaleX_ = o1.arcScaleX_; o2.arcScaleY_ = o1.arcScaleY_; o2.lineScale_ = o1.lineScale_; + o2.rotation_ = o1.rotation_; // used for images } var colorData = { @@ -599,6 +600,7 @@ this.arcScaleX_ = 1; this.arcScaleY_ = 1; this.lineScale_ = 1; + this.rotation_ = 0; } var contextPrototype = CanvasRenderingContext2D_.prototype; @@ -763,23 +765,31 @@ return gradient; }; - contextPrototype.drawImage = function(image, var_args) { + contextPrototype.drawImage = function(image) { var dx, dy, dw, dh, sx, sy, sw, sh; - + + // to fix new Image() we check the existance of runtimeStyle + var rts = image.runtimeStyle.width; + // to find the original width we overide the width and height - var oldRuntimeWidth = image.runtimeStyle.width; - var oldRuntimeHeight = image.runtimeStyle.height; - image.runtimeStyle.width = 'auto'; - image.runtimeStyle.height = 'auto'; + if(rts) { + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + } // get the original size var w = image.width; var h = image.height; - + // and remove overides - image.runtimeStyle.width = oldRuntimeWidth; - image.runtimeStyle.height = oldRuntimeHeight; - + if(rts) { + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + } + if (arguments.length == 3) { dx = arguments[1]; dy = arguments[2]; @@ -816,29 +826,44 @@ var W = 10; var H = 10; + + var scaleX = scaleY = 1; + + // FIX: divs give better quality then vml image and also fixes transparent PNG's + vmlStr.push('