summaryrefslogtreecommitdiff
path: root/js/render.js
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2014-01-26 02:55:13 -0500
committerjules <jules@okfoc.us>2014-01-26 02:55:13 -0500
commitfb322430f61b32af4e22d5136704ce87ddfd6f3a (patch)
treeb7ff726d4b5e7ba425640ce1a1e8eeafc3008705 /js/render.js
parent41c9d39a851a159d6a2e34fafb975e7c66bddf63 (diff)
actual_w, actual_h to fix rgbpixel on resized workspace
Diffstat (limited to 'js/render.js')
-rw-r--r--js/render.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/render.js b/js/render.js
index 993ba0e..e379ab8 100644
--- a/js/render.js
+++ b/js/render.js
@@ -21,8 +21,8 @@ function ready(){
loading = false
if (window.gif) {
frame = gif.frames[0]
- w = cc.canvas.width = frame.ctx.canvas.width
- h = cc.canvas.height = frame.ctx.canvas.height
+ actual_w = w = cc.canvas.width = frame.ctx.canvas.width
+ actual_h = h = cc.canvas.height = frame.ctx.canvas.height
for (var i=0, f; f=gif.frames[i]; i++){
f.cloneData = f.ctx.getImageData(0,0,w,h)
}
@@ -31,8 +31,8 @@ function ready(){
fc = cq(img.width, img.height)
fc.drawImage(img, 0, 0)
frame = img_frame = { ctx: fc.context }
- w = cc.canvas.width = frame.ctx.canvas.width
- h = cc.canvas.height = frame.ctx.canvas.height
+ actual_w = w = cc.canvas.width = frame.ctx.canvas.width
+ actual_h = h = cc.canvas.height = frame.ctx.canvas.height
frame.cloneData = frame.ctx.getImageData(0,0,w,h)
}
else {
@@ -66,8 +66,8 @@ function giveFrame(t){
}
function empty_frame(){
- w = w || 400
- h = h || 266
+ actual_w = w = w || 400
+ actual_h = h = h || 266
var cx = cq(w, h).fillStyle("rgba(255,255,255,255)").fillRect(0,0,w,h)
return { ctx: cx.context, cloneData: cx.getImageData(0,0,w,h) }
}