Hide Curve#getLength() parameters from Bootstrap so it injects bean too.

This commit is contained in:
Jürg Lehni 2011-03-08 17:31:36 +00:00
parent 72469dc65f
commit 526e2ea0ba
3 changed files with 7 additions and 6 deletions

View file

@ -49,9 +49,9 @@ var Line = this.Line = Base.extend({
? this.point.add(this.vector.multiply(t1)) : null;
},
getSide: function(p) {
getSide: function(point) {
var v1 = this.vector,
v2 = p.subtract(this.point),
v2 = point.subtract(this.point),
ccw = v2.cross(v1);
if (ccw == 0.0) {
ccw = v2.dot(v1);

View file

@ -228,7 +228,7 @@ var Point = this.Point = Base.extend({
* @param point
*/
getAngle: function(/* point */) {
// Hide point from Bootstrap so it injects bean too
// Hide parameters from Bootstrap so it injects bean too
return this.getAngleInRadians(arguments[0]) * 180 / Math.PI;
},
@ -243,7 +243,7 @@ var Point = this.Point = Base.extend({
},
getAngleInRadians: function(/* point */) {
// Hide point from Bootstrap so it injects bean too
// Hide parameters from Bootstrap so it injects bean too
if (arguments[0] === undefined) {
if (this._angle == null)
this._angle = Math.atan2(this.y, this.x);

View file

@ -156,10 +156,11 @@ var Curve = this.Curve = Base.extend({
// TODO: Port back to Scriptographer, optionally suppporting from, to
// TODO: Replaces getPartLength(fromParameter, toParameter)?
getLength: function(from, to) {
getLength: function(/* from, to */) {
// Hide parameters from Bootstrap so it injects bean too
var args = this.getCurveValues();
if (arguments.length > 0)
args.push(from, to);
args.push(arguments[0], arguments[1]);
return Curve.getLength.apply(Curve, args);
},