summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-02-18 13:07:21 -0500
committerJules Laplace <jules@okfoc.us>2015-02-18 13:07:21 -0500
commit5b7549932c55ebe7388258fb19b65a907dd5d3d1 (patch)
tree58a91193e85c6088e05c58012dcdce868cb8806c
parentd67f7095d4d3f061431d9ec88996cda0e9b00267 (diff)
dont break the thing if you click one of the width/height fields
-rw-r--r--css/sally.css2
-rw-r--r--js/ui/controls.js8
2 files changed, 6 insertions, 4 deletions
diff --git a/css/sally.css b/css/sally.css
index 6fdbe55..a3ffc1a 100644
--- a/css/sally.css
+++ b/css/sally.css
@@ -59,7 +59,7 @@ body { transition: 0.1s linear; }
textarea { font-size:12pt; width: 42%; height: 300px; background: #333; color: #0f0; border: 0; font-family: 'FixedsysExcelsior301Regular'; outline: 0; border: 1px solid #333; background:#010;}
#shader_rapper { display: none; }
#import_rapper { display: none; }
-#cursor_input { position: absolute; top: 0; right: 0; width:30px; opacity: 0; }
+#cursor_input { position: fixed; top: 0; right: 0; width:30px; opacity: 0; }
.selector_el {
border: 1px dashed #fff !important;
padding-top: 1px;
diff --git a/js/ui/controls.js b/js/ui/controls.js
index 6f0fb91..485f690 100644
--- a/js/ui/controls.js
+++ b/js/ui/controls.js
@@ -203,14 +203,15 @@ var controls = (function(){
controls.canvas_width.key = int_key(function(n, keyCode){
controls.canvas_width.read()
- if (controls.canvas_width.char.length == 1) {
+ if (controls.canvas_width.char.length < 3) {
n = parseInt(controls.canvas_width.char) * 10 + n
}
controls.canvas_width.char = ""+n
controls.canvas_width.build()
})
controls.canvas_width.onBlur = function(){
- var w = parseInt(controls.canvas_width.char) || 1
+ var w = parseInt(controls.canvas_width.char)
+ if (! w) return;
controls.canvas_width.char = w+""
controls.canvas_width.build()
canvas.resize(w, canvas.h)
@@ -225,7 +226,8 @@ var controls = (function(){
controls.canvas_height.build()
})
controls.canvas_height.onBlur = function(){
- var h = parseInt(controls.canvas_height.char) || 1
+ var h = parseInt(controls.canvas_height.char)
+ if (! h) return;
controls.canvas_height.char = h+""
controls.canvas_height.build()
canvas.resize(canvas.w, h)