From 885eb0a563ee8cca016ad4448b8571a0e9b024ac Mon Sep 17 00:00:00 2001 From: adplantade Date: Sat, 20 Jun 2020 09:48:05 +0200 Subject: [PATCH] correction de l'affichage de pierres sur las vitraux --- code/index.html | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/code/index.html b/code/index.html index c3413a6..386457f 100644 --- a/code/index.html +++ b/code/index.html @@ -100,17 +100,18 @@ function drawImg(x,y,color,lectx) { var img= new Image(); - img.src="ress/"+color+".png"; //lectx2=eval(lectx); - nx=(width/6)*(x>0 ? x+2 : x+3); - ny=(height/6)*(y>0 ? y+2 : y+3); + var nx=(width/6)*(x>0 ? x+2 : x+3); + var ny=(height/6)*(y>0 ? y+2 : y+3); img.onload = function(){ console.log("x:"+x+" y:"+y+" col:"+color); lectx.drawImage(img,nx,ny,width/6,height/6); } + + img.src="ress/"+color+".png"; } function tourneG(letab,lecanvas,lectx) @@ -150,6 +151,7 @@ lectx.clearRect(0, 0, lecanvas.width, lecanvas.height); if(pts[0]) { + for(i=1;i