From c7c4048a44e54f0d61f3b07f11a70c5994a9da66 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Tue, 5 Oct 2021 15:50:11 +0200 Subject: Cleaning --- public/js/p5_custom.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'public/js') diff --git a/public/js/p5_custom.js b/public/js/p5_custom.js index 2cf742b..19a8dd0 100644 --- a/public/js/p5_custom.js +++ b/public/js/p5_custom.js @@ -1,5 +1,5 @@ -draw_arrow=function(p,x1,y1,x2,y2,elt=null,canvas,skiparrow=false){ +draw_arrow=function(p,x1,y1,x2,y2,elt=null,canvas,skiparrow=false,flip=false){ var offset=5 // Reduce the length of the vector to have a better tip location @@ -30,6 +30,12 @@ draw_arrow=function(p,x1,y1,x2,y2,elt=null,canvas,skiparrow=false){ xfactor=1-yfactor justify=15 + if(flip){ + xfactor=-xfactor + yfactor=-yfactor + } + + if(angle>0){ yfactor=-yfactor } -- cgit v1.2.3