diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-10-05 15:50:11 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-10-05 15:50:11 +0200 |
| commit | c7c4048a44e54f0d61f3b07f11a70c5994a9da66 (patch) | |
| tree | 3c644231a272d5d11343a5e76ff051960df7e675 /public/js/p5_custom.js | |
| parent | 442a9e9c85499c692dcd2d111b634ffd524e16af (diff) | |
Cleaning
Diffstat (limited to 'public/js/p5_custom.js')
| -rw-r--r-- | public/js/p5_custom.js | 8 |
1 files changed, 7 insertions, 1 deletions
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 } |
