From 6d2b1944fac07a4bacff840f56f81fed54f82d75 Mon Sep 17 00:00:00 2001 From: juliandescottes Date: Wed, 29 Aug 2012 13:46:57 +0200 Subject: [PATCH] Use slider for choosing FPS --- css/style.css | 4 ++++ index.html | 3 ++- js/piskel.js | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/css/style.css b/css/style.css index 3914911a..554be333 100644 --- a/css/style.css +++ b/css/style.css @@ -134,6 +134,10 @@ ul, li { margin : 5px; } +#preview-fps { + width : 200px; +} + /* Force apparition of scrollbars on leopard */ ::-webkit-scrollbar { -webkit-appearance: none; diff --git a/index.html b/index.html index f167a51d..4800f151 100644 --- a/index.html +++ b/index.html @@ -33,7 +33,8 @@
- + + 12 fps
diff --git a/js/piskel.js b/js/piskel.js index 619af33d..527989a0 100644 --- a/js/piskel.js +++ b/js/piskel.js @@ -149,7 +149,7 @@ }; var refreshUpdater = startPreviewRefresh(); - animFPSTuner.addEventListener('keyup', function(evt) { + animFPSTuner.addEventListener('change', function(evt) { window.clearInterval(refreshUpdater); animPreviewFPS = parseInt(animFPSTuner.value, 10); if(isNaN(animPreviewFPS)) { @@ -167,6 +167,7 @@ if(animPreviewFPS > 100) { animPreviewFPS = 100; } + $("display-fps").innerHTML = animPreviewFPS + " fps"; animFPSTuner.value = animPreviewFPS; refreshUpdater = startPreviewRefresh(); });