From 526e2ea0ba284a6a082cdff53562a504fe1c39c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 8 Mar 2011 17:31:36 +0000 Subject: [PATCH] Hide Curve#getLength() parameters from Bootstrap so it injects bean too. --- src/basic/Line.js | 4 ++-- src/basic/Point.js | 4 ++-- src/path/Curve.js | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/basic/Line.js b/src/basic/Line.js index e5f40c35..e9708af9 100644 --- a/src/basic/Line.js +++ b/src/basic/Line.js @@ -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); diff --git a/src/basic/Point.js b/src/basic/Point.js index 7e384a72..a78867c4 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -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); diff --git a/src/path/Curve.js b/src/path/Curve.js index df3a5767..f4be3fd9 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -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); },