mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 23:39:59 -05:00
Hide Curve#getLength() parameters from Bootstrap so it injects bean too.
This commit is contained in:
parent
72469dc65f
commit
526e2ea0ba
3 changed files with 7 additions and 6 deletions
|
@ -49,9 +49,9 @@ var Line = this.Line = Base.extend({
|
||||||
? this.point.add(this.vector.multiply(t1)) : null;
|
? this.point.add(this.vector.multiply(t1)) : null;
|
||||||
},
|
},
|
||||||
|
|
||||||
getSide: function(p) {
|
getSide: function(point) {
|
||||||
var v1 = this.vector,
|
var v1 = this.vector,
|
||||||
v2 = p.subtract(this.point),
|
v2 = point.subtract(this.point),
|
||||||
ccw = v2.cross(v1);
|
ccw = v2.cross(v1);
|
||||||
if (ccw == 0.0) {
|
if (ccw == 0.0) {
|
||||||
ccw = v2.dot(v1);
|
ccw = v2.dot(v1);
|
||||||
|
|
|
@ -228,7 +228,7 @@ var Point = this.Point = Base.extend({
|
||||||
* @param point
|
* @param point
|
||||||
*/
|
*/
|
||||||
getAngle: function(/* 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;
|
return this.getAngleInRadians(arguments[0]) * 180 / Math.PI;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ var Point = this.Point = Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
getAngleInRadians: function(/* point */) {
|
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 (arguments[0] === undefined) {
|
||||||
if (this._angle == null)
|
if (this._angle == null)
|
||||||
this._angle = Math.atan2(this.y, this.x);
|
this._angle = Math.atan2(this.y, this.x);
|
||||||
|
|
|
@ -156,10 +156,11 @@ var Curve = this.Curve = Base.extend({
|
||||||
|
|
||||||
// TODO: Port back to Scriptographer, optionally suppporting from, to
|
// TODO: Port back to Scriptographer, optionally suppporting from, to
|
||||||
// TODO: Replaces getPartLength(fromParameter, toParameter)?
|
// 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();
|
var args = this.getCurveValues();
|
||||||
if (arguments.length > 0)
|
if (arguments.length > 0)
|
||||||
args.push(from, to);
|
args.push(arguments[0], arguments[1]);
|
||||||
return Curve.getLength.apply(Curve, args);
|
return Curve.getLength.apply(Curve, args);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue