fix bug where pressing enter updated shader instead of camera distance
This commit is contained in:
parent
4fb99acd00
commit
6a1b25777d
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
</div>
|
||||
<div class='ui-block'>
|
||||
<input id='input1' value='50'></input>
|
||||
<button id='button3'>Change camera distance</button>
|
||||
<button id='changedistance'>Change camera distance</button>
|
||||
<div style='display: inline'>Max distance is 1000</div>
|
||||
</div>
|
||||
<div class='ui-block'>
|
||||
<input id='input2' value='5'></input>
|
||||
<button id='button4'>Change circle size</button>
|
||||
<button id='changecirclesize'>Change circle size</button>
|
||||
</div>
|
||||
<div class='ui-block'>
|
||||
<button id='sphere'>Set obj to sphere</button>
|
||||
|
|
Loading…
Reference in New Issue