Skip to content
Browse files

Added chainability to path object

  • Loading branch information...
1 parent d8d575f commit 85a6e5cf77533b5c95a0246d013f854a0064f263 @JoelBesada committed Feb 20, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 script/jquery.scrollpath.js
View
8 script/jquery.scrollpath.js
@@ -153,6 +153,8 @@
if( settings.name ) nameMap[ settings.name ] = path.length - 1;
rotation = radians % ( Math.PI*2 );
+
+ return this;
};
/* Moves (jumps) directly to the given point */
@@ -174,6 +176,8 @@
updateCanvas( x, y );
canvasPath.push({ method: "moveTo", args: arguments });
+
+ return this;
};
/* Draws a straight path to the given point */
@@ -203,6 +207,8 @@
updateCanvas( x, y );
canvasPath.push({ method: "lineTo", args: arguments });
+
+ return this;
};
/* Draws an arced path with a given circle center, radius, start and end angle. */
@@ -242,6 +248,8 @@
updateCanvas( centerX + radius, centerY + radius );
updateCanvas( centerX - radius, centerY - radius );
canvasPath.push({ method: "arc", args: arguments });
+
+ return this;
};
this.getPath = function() {

0 comments on commit 85a6e5c

Please sign in to comment.
Something went wrong with that request. Please try again.