From c353c87c511b9d447f39f78826030d15a76b2691 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Tue, 5 Oct 2021 20:12:35 +0200 Subject: Update --- public/js/p5_custom.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'public/js') diff --git a/public/js/p5_custom.js b/public/js/p5_custom.js index 19a8dd0..53a1156 100644 --- a/public/js/p5_custom.js +++ b/public/js/p5_custom.js @@ -40,8 +40,15 @@ draw_arrow=function(p,x1,y1,x2,y2,elt=null,canvas,skiparrow=false,flip=false){ yfactor=-yfactor } - cp=canvas.position() - elt.position(cp.x+center.x+justify*xfactor-5,cp.y+center.y-justify*yfactor-elt.elt.offsetHeight/2) + cp=canvas.position() + elt_x=cp.x+center.x+justify*xfactor-5 + elt_y=cp.y+center.y-justify*yfactor-elt.elt.offsetHeight/2 + if (elt_x(canvas.width+cp.x) || elt_y>(canvas.height+cp.y)){ + elt.elt.style.display="none" + } else { + elt.elt.style.display="block" + } + elt.position(elt_x,elt_y) } -- cgit v1.2.3