diff options
| author | jules <jules@okfoc.us> | 2014-02-01 12:32:20 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-02-01 12:32:20 -0500 |
| commit | 023684efdf8983362fddef2a3aa36838b90dbf00 (patch) | |
| tree | ca44f7a3d1e950eeae9242608945e038760e7df8 | |
| parent | 41ea911a10df577e1bb340d996c627f74417e6f2 (diff) | |
fix w/h issue
| -rw-r--r-- | js/api/gallery.js | 4 | ||||
| -rw-r--r-- | js/render.js | 5 | ||||
| -rw-r--r-- | shader-combo.html | 6 |
3 files changed, 10 insertions, 5 deletions
diff --git a/js/api/gallery.js b/js/api/gallery.js index ae50dc9..8cb738b 100644 --- a/js/api/gallery.js +++ b/js/api/gallery.js @@ -58,8 +58,8 @@ function run_shader(shader_object){ $("#url").val( shader_object.image_url ) if (new_w && new_h) { preserve_dimensions = true - w = new_w - h = new_h + actual_w = w = new_w + actual_h = h = new_h } load() } diff --git a/js/render.js b/js/render.js index 68554cb..955f525 100644 --- a/js/render.js +++ b/js/render.js @@ -6,6 +6,7 @@ var preserve_dimensions = true; function choose (){ loading = true + preserve_dimensions = false $("#url").val(this.src) loadImage(this.src, ready) reset() @@ -27,7 +28,7 @@ function ready(){ frame = gif.frames[0] cc.canvas.width = frame.ctx.canvas.width cc.canvas.height = frame.ctx.canvas.height - if (preserve_dimensions) { + if (! preserve_dimensions) { actual_w = w = cc.canvas.width actual_h = h = cc.canvas.height } @@ -41,7 +42,7 @@ function ready(){ frame = img_frame = { ctx: fc.context } cc.canvas.width = frame.ctx.canvas.width cc.canvas.height = frame.ctx.canvas.height - if (preserve_dimensions) { + if (! preserve_dimensions) { actual_w = w = cc.canvas.width actual_h = h = cc.canvas.height } diff --git a/shader-combo.html b/shader-combo.html index da7f579..2ef8ed1 100644 --- a/shader-combo.html +++ b/shader-combo.html @@ -1,8 +1,9 @@ <!doctype html> <html> <head> +<title>Shaderblaster</title> <style type="text/css"> -body { background: #f8f8f8; font-size: 14px } +body { background: #f8f8f8; font-size: 14px; } div { float: left; padding: 10px;} form { display: inline-block; } a { color: #00f; } @@ -50,10 +51,13 @@ a { color: #00f; } #render,#save,#upload,#save-shader { font-weight: bold; } #save[disabled],#upload[disabled] { font-weight: normal; } + +#logo { position: fixed; bottom: 10px; right: 10px; font-size: 38px; font-weight: bold; font-style: italic; margin-top: 0px; margin: 0 5px; color: #000; } </style> </head> <body> +<h1 id="logo">shaderblaster</h1> <div id="header"> <button id="help">help</button> |
