raphael js rounded rectangle 28another solution 29

Solutions on MaxInterview for raphael js rounded rectangle 28another solution 29 by the best coders in the world

showing results for - "raphael js rounded rectangle 28another solution 29"
Niko
07 Jun 2020
1Raphael.fn.roundedRectangle = function (x, y, w, h, r1, r2, r3, r4){
2  var array = [];
3  array = array.concat(["M",x+r1,y]);
4  array = array.concat(['l',w-r1-r2,0]);//T
5  array = array.concat(["q",r2,0, r2,r2]); //TR
6  array = array.concat(['l',0,h-r3-r2]);//R
7  array = array.concat(["q",0,r3, -r3,r3]); //BR
8  array = array.concat(['l',-w+r4+r3,0]);//B
9  array = array.concat(["q",-r4,0, -r4,-r4]); //BL
10  array = array.concat(['l',0,-h+r4+r1]);//L
11  array = array.concat(["q",0,-r1, r1,-r1]); //TL
12  array = array.concat(["z"]); //end
13
14  return this.path(array);
15};
16