raphael.js描边/路径宽度似乎无效。

4
我正在处理一项琐事,但无法控制路径的宽度。
请看倒数第二行,真是令人困惑:
var paper = Raphael(20, 20, 320, 320);

  function arc(center, radius, startAngle, endAngle) {
      angle = startAngle;
      coords = toCoords(center, radius, angle);
      path = "M " + coords[0] + " " + coords[1];
      while(angle<=endAngle) {
          coords = toCoords(center, radius, angle);
          path += " L " + coords[0] + " " + coords[1];
          angle += 1;
      }
      return path;
  }

  function toCoords(center, radius, angle) {
      var radians = (angle/180) * Math.PI;
      var x = center[0] + Math.cos(radians) * radius;
      var y = center[1] + Math.sin(radians) * radius;
      return [x, y];
  }
  var ps = paper.path(arc([100, 100], 80, -90, 90));
  ps.attr({stroke:'#C00',width:100});
  ps.glow({color: '#f00',width: 20});​

这是jsfiddle代码片段链接:http://jsfiddle.net/U5Kpx/5/,请问有人能看出我在这里做错了什么吗?非常感谢。
1个回答

8

您应该使用stroke-width属性。

例如:

ps.attr({stroke:'#C00',"stroke-width":5});
ps.glow({color: '#f00',width: 40});​

Check this fiddle


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接