📜  raphael js 圆角矩形(另一种解决方案) - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:23.843000             🧑  作者: Mango

代码示例1
Raphael.fn.roundedRectangle = function (x, y, w, h, r1, r2, r3, r4){
  var array = [];
  array = array.concat(["M",x+r1,y]);
  array = array.concat(['l',w-r1-r2,0]);//T
  array = array.concat(["q",r2,0, r2,r2]); //TR
  array = array.concat(['l',0,h-r3-r2]);//R
  array = array.concat(["q",0,r3, -r3,r3]); //BR
  array = array.concat(['l',-w+r4+r3,0]);//B
  array = array.concat(["q",-r4,0, -r4,-r4]); //BL
  array = array.concat(['l',0,-h+r4+r1]);//L
  array = array.concat(["q",0,-r1, r1,-r1]); //TL
  array = array.concat(["z"]); //end

  return this.path(array);
};