diff options
| author | jules <jules@okfoc.us> | 2014-02-01 12:48:42 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-02-01 12:48:42 -0500 |
| commit | 27e0dfdf406b65c1ed81cf4f52c7dd1078468336 (patch) | |
| tree | 654d8140524e692b6f0cb040143b6bf2af9a2a6a /js | |
| parent | 42ad490303827327163a62aaa824d6ffc4af0016 (diff) | |
set actual_w/actual_h
Diffstat (limited to 'js')
| -rw-r--r-- | js/render.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/js/render.js b/js/render.js index 955f525..7eea965 100644 --- a/js/render.js +++ b/js/render.js @@ -26,27 +26,27 @@ function ready(){ status("") if (window.gif) { frame = gif.frames[0] - cc.canvas.width = frame.ctx.canvas.width - cc.canvas.height = frame.ctx.canvas.height + actual_w = cc.canvas.width = frame.ctx.canvas.width + actual_h = cc.canvas.height = frame.ctx.canvas.height if (! preserve_dimensions) { - actual_w = w = cc.canvas.width - actual_h = h = cc.canvas.height + w = actual_w + h = actual_h } for (var i=0, f; f=gif.frames[i]; i++){ - f.cloneData = f.ctx.getImageData(0,0,cc.canvas.width,cc.canvas.height) + f.cloneData = f.ctx.getImageData(0,0,actual_w,actual_h) } } else if (window.img) { fc = cq(img.width, img.height) fc.drawImage(img, 0, 0) frame = img_frame = { ctx: fc.context } - cc.canvas.width = frame.ctx.canvas.width - cc.canvas.height = frame.ctx.canvas.height + actual_w = cc.canvas.width = frame.ctx.canvas.width + actual_h = cc.canvas.height = frame.ctx.canvas.height if (! preserve_dimensions) { - actual_w = w = cc.canvas.width - actual_h = h = cc.canvas.height + w = actual_w + h = actual_h } - frame.cloneData = frame.ctx.getImageData(0,0,cc.canvas.width,cc.canvas.height) + frame.cloneData = frame.ctx.getImageData(0,0,actual_w,actual_h) } else { cc.canvas.width = actual_w = w |
