small fix

This commit is contained in:
Mahdi Dibaiee 2015-01-08 15:50:14 +03:30
parent 6014ee899a
commit ebdd105b56

24
main.js
View File

@ -11,16 +11,22 @@ img.onload = function() {
img.onload(); img.onload();
radius.addEventListener('mousedown', function() {
radius.isMouseDown = true;
});
radius.addEventListener('mousemove', function() {
if(radius.isMouseDown) rshow.textContent = radius.value;
})
radius.onchange = function() { radius.onchange = function() {
rshow.textContent = radius.value; radius.isMouseDown = false;
setTimeout(function() { c.drawImage(img, 0, 0);
c.drawImage(img, 0, 0); for(var i = 0; i < +radius.value/5; i++) {
for(var i = 0; i < +radius.value/5; i++) { blur(5)
blur(5) }
} var modulo = +radius.value / 5;
var modulo = +radius.value / 5; if(modulo > 0) blur(modulo);
if(modulo > 0) blur(modulo);
}, 100);
} }
function gaussian(x, max) { function gaussian(x, max) {