jsPlumb-connectors-raphael-1.2.6-RC1.js 864 B

12345678910111213141516171819202122
  1. jsPlumb.Connectors.SVGBezier = function(curviness)
  2. {
  3. var paper = null;
  4. jsPlumb.Connectors.Bezier.apply(this, arguments);
  5. this.paint = function(d, ctx) {
  6. if (paper) paper.remove(); // not ideal. we want to just move it, really.
  7. // this is just an experiment right now. things will improve.
  8. paper = Raphael(d[0], d[1], d[2], d[3]);
  9. var path = "M " + d[4] + " " + d[5] + " C " + d[8] + " " + d[9] + " " + d[10] + " " + d[11] + " " + d[6] + " " + d[7];
  10. // todo the stroke style etc should be passed in here, not read out of the context.
  11. // it's only like this because the original implementation painted on canvas, and jsPlumb
  12. // was taking care of paint styles etc.
  13. paper.path(path).attr({
  14. stroke:ctx.strokeStyle,
  15. "stroke-width":ctx.lineWidth
  16. });
  17. };
  18. };