Documentation fixes + custom attributes and getPointAtLength fix
[raphael] / raphael.js
index 2fd5b72..42b93ce 100644 (file)
             was: Object.prototype[has].call(g.win, "Raphael"),
             is: g.win.Raphael
         },
-        Paper = function () {},
+        Paper = function () {
+            
+            this.customAttributes = {};
+        },
         paperproto,
         appendChild = "appendChild",
         apply = "apply",
     R._Paper = Paper;
     
     R.fn = paperproto = Paper.prototype = R.prototype;
-    
-    paperproto.customAttributes = {};
     R._id = 0;
     R._oid = 0;
     
                 sp += p.shift() + p;
             }
             subpaths.end = sp;
-            point = istotal ? len : subpath ? subpaths : R.findDotsAtSegment(x, y, p[1], p[2], p[3], p[4], p[5], p[6], 1);
+            point = istotal ? len : subpath ? subpaths : R.findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
             point.alpha && (point = {x: point.x, y: point.y, alpha: point.alpha});
             return point;
         };
     R.getPointAtLength = getPointAtLength;
     
     R.getSubpath = function (path, from, to) {
-        if (abs(this.getTotalLength(path) - to) < 1e-6) {
+        if (this.getTotalLength(path) - to < 1e-6) {
             return getSubpathsAtLength(path, from).end;
         }
         var a = getSubpathsAtLength(path, to, 1);
@@ -3968,7 +3969,6 @@ window.Raphael.svg && function (R) {
     Element.prototype = elproto;
     elproto.constructor = Element;
 
-    
     R._engine.path = function (pathString, SVG) {
         var el = $("path");
         SVG.canvas && SVG.canvas.appendChild(el);
@@ -4585,7 +4585,6 @@ window.Raphael.vml && function (R) {
         params.cursor && (s.cursor = params.cursor);
         "blur" in params && o.blur(params.blur);
         if (params.path && o.type == "path" || newpath) {
-            // node.path = path2vml(a.path);
             node.path = path2vml(~Str(a.path).toLowerCase().indexOf("r") ? R._pathToAbsolute(a.path) : a.path);
             if (o.type == "image") {
                 o._.fillpos = [a.x, a.y];