From 6a1b25777d65d6ee754c47bd8ef554413ec24e8b Mon Sep 17 00:00:00 2001 From: gbrochar Date: Tue, 24 Nov 2020 17:04:33 +0100 Subject: [PATCH] fix bug where pressing enter updated shader instead of camera distance --- src/client/main.ts | 8 ++++---- views/index.ejs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/main.ts b/src/client/main.ts index 4833871..fe96285 100644 --- a/src/client/main.ts +++ b/src/client/main.ts @@ -254,13 +254,13 @@ async function main() { $('#input1').on('keypress', function(event: any) { if (event.which === 13) { event.preventDefault(); - $('#button3').click(); + $('#changedistance').click(); } }); $('#input2').on('keypress', function(event: any) { if (event.which === 13) { event.preventDefault(); - $('#button4').click(); + $('#changecirclesize').click(); } }); $('#button1').on('click', function() { @@ -275,11 +275,11 @@ async function main() { [programInfo, fragmentShader] = changeFragmentShader(gl, shaderProgram, fragmentShader, fsSource3, vsSource); }); - $('#button3').on('click', function() { + $('#changedistance').on('click', function() { distance = $('#input1').val(); distance = parseFloat(distance); }); - $('#button4').on('click', function() { + $('#changecirclesize').on('click', function() { circleSize = $('#input2').val(); circleSize = parseFloat(circleSize); }); diff --git a/views/index.ejs b/views/index.ejs index da9b7bf..c52cb1c 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -21,12 +21,12 @@
- +
Max distance is 1000
- +