diff options
| -rw-r--r-- | js/render.js | 20 | ||||
| -rw-r--r-- | shader-combo.html | 10 |
2 files changed, 18 insertions, 12 deletions
diff --git a/js/render.js b/js/render.js index f6684d7..993ba0e 100644 --- a/js/render.js +++ b/js/render.js @@ -1,7 +1,8 @@ var frame, img_frame; var timeout, raf_id, start_t = 0, old_t = 0, pause_t = 0 -var paused = false, dragging = false, rendering = false, scrolling = false, deferring = false, scrollTimeout = null; -var fps = 30; +var paused = false, dragging = false, rendering = false, scrolling = false, deferring = false, scrollTimeout = null +var fps = 30 +var imageURL = "" function choose (){ imageURL = this.src @@ -46,16 +47,7 @@ function displayWidthHeight(width, height){ $("#width").val(width) $("#height").val(height) } -$("#width").change(function(){ - w = abs(parseInt(this.value,10)) || 1 - cc.canvas.width = w - cc.canvas.height = h -}) -$("#height").change(function(){ - h = abs(parseInt(this.value,10)) || 1 - cc.canvas.width = w - cc.canvas.height = h -}) + function giveFrame(t){ if (window.gif) { if (gif.currentFrame) { @@ -80,6 +72,10 @@ function empty_frame(){ return { ctx: cx.context, cloneData: cx.getImageData(0,0,w,h) } } +function feedback_frame(){ + return { ctx: cc.context, cloneData: cc.getImageData(0,0,w,h) } +} + function reset(){ start_t = old_t pause_t = 0 diff --git a/shader-combo.html b/shader-combo.html index e61beee..0a5fcab 100644 --- a/shader-combo.html +++ b/shader-combo.html @@ -193,6 +193,16 @@ function init(){ $("#header .form").hide() $(".bold").removeClass("bold") }) + $("#width").change(function(){ + w = abs(parseInt(this.value,10)) || 1 + cc.canvas.width = w + cc.canvas.height = h + }) + $("#height").change(function(){ + h = abs(parseInt(this.value,10)) || 1 + cc.canvas.width = w + cc.canvas.height = h + }) frame_editor.init() help.init() |
