improved Spline docs

This commit is contained in:
Eric Rowell 2012-12-31 20:34:50 -08:00
parent 176e805e58
commit e44f369bf1

View File

@ -1,11 +1,13 @@
(function() { (function() {
/** /**
* Spline constructor.  Splines are defined by an array of points * Spline constructor.  Splines are defined by an array of points and
* a tension
* @constructor * @constructor
* @augments Kinetic.Shape * @augments Kinetic.Shape
* @param {Object} config * @param {Object} config
* @param {Array} config.points can be a flattened array of points, or an array of point objects. * @param {Array} config.points can be a flattened array of points, or an array of point objects.
* e.g. [0,1,2,3] and [{x:1,y:2},{x:3,y:4}] are equivalent * e.g. [0,1,2,3] and [{x:1,y:2},{x:3,y:4}] are equivalent
* @param {Number} config.tension default value is 1. Higher values will result in a more curvy line. A value of 0 will result in no interpolation.
*/ */
Kinetic.Spline = function(config) { Kinetic.Spline = function(config) {
this._initSpline(config); this._initSpline(config);
@ -28,7 +30,7 @@
this.setDefaultAttrs({ this.setDefaultAttrs({
points: [], points: [],
lineCap: 'butt', lineCap: 'butt',
tension: 0 tension: 1
}); });
this.shapeType = 'Spline'; this.shapeType = 'Spline';