1
0
forked from gee/bd-chapril

Zoomable canvas picture without movement in the page

This commit is contained in:
Frédéric Henry 2025-01-03 01:49:58 +01:00
parent cfb38ea271
commit 392dd2a4aa
Signed by: fhenry2
GPG Key ID: D752390BFF432D86
2 changed files with 5 additions and 5 deletions

View File

@ -61,7 +61,7 @@
<!-- fin tableau de bord -->
<div id="cscreen">
<canvas class="rc" id="c" crossorigin="anonymous" width="800" height="600">
<canvas class="rc" id="c" crossorigin="anonymous" width="800" height="600" tabindex=0>
Le générateur du GKND a besoin d'un navigateur récent et de javascript pour fonctionner.
</canvas>
</div>

View File

@ -33,7 +33,7 @@ cg.clearScreen = function(){
$(d).on('keyup', function(e){
var key = e.keyCode || e.which;
var key = e.which;
if(key == 46 && currentObj){
scene.remove(currentObj);
@ -47,9 +47,9 @@ $(d).on('keyup', function(e){
}
});
$(d).on('keydown', function(event){
var key = event.keyCode || event.which;
canvas.on('focusin').on('keydown', function(event){
event.preventDefault();
var key = event.which;
if(key == 38 && currentObj){
cg.zoomIn(currentObj);