[canviz] r355 committed - Ellipse.js: make KAPPA a local variable; we don't need to export that ...

2 views
Skip to first unread message

can...@googlecode.com

unread,
Jan 31, 2012, 8:47:51 PM1/31/12
to canviz-...@googlegroups.com
Revision: 355
Author: ryandesign.com
Date: Tue Jan 31 17:47:22 2012
Log: Ellipse.js: make KAPPA a local variable; we don't need to export
that in the prototype

http://code.google.com/p/canviz/source/detail?r=355

Modified:
/path/trunk/src/Ellipse.js

=======================================
--- /path/trunk/src/Ellipse.js Tue Jan 31 17:30:29 2012
+++ /path/trunk/src/Ellipse.js Tue Jan 31 17:47:22 2012
@@ -15,30 +15,31 @@
this.cy += dy;
return this;
};
-Ellipse.prototype.KAPPA = 0.5522847498;
+
+var KAPPA = 0.5522847498;
Ellipse.prototype.setupSegments = function() {
this.addBezier([
new Point(this.cx, this.cy - this.ry),
- new Point(this.cx + this.KAPPA * this.rx, this.cy - this.ry),
- new Point(this.cx + this.rx, this.cy - this.KAPPA * this.ry),
+ new Point(this.cx + KAPPA * this.rx, this.cy - this.ry),
+ new Point(this.cx + this.rx, this.cy - KAPPA * this.ry),
new Point(this.cx + this.rx, this.cy)
]);
this.addBezier([
new Point(this.cx + this.rx, this.cy),
- new Point(this.cx + this.rx, this.cy + this.KAPPA * this.ry),
- new Point(this.cx + this.KAPPA * this.rx, this.cy + this.ry),
+ new Point(this.cx + this.rx, this.cy + KAPPA * this.ry),
+ new Point(this.cx + KAPPA * this.rx, this.cy + this.ry),
new Point(this.cx, this.cy + this.ry)
]);
this.addBezier([
new Point(this.cx, this.cy + this.ry),
- new Point(this.cx - this.KAPPA * this.rx, this.cy + this.ry),
- new Point(this.cx - this.rx, this.cy + this.KAPPA * this.ry),
+ new Point(this.cx - KAPPA * this.rx, this.cy + this.ry),
+ new Point(this.cx - this.rx, this.cy + KAPPA * this.ry),
new Point(this.cx - this.rx, this.cy)
]);
this.addBezier([
new Point(this.cx - this.rx, this.cy),
- new Point(this.cx - this.rx, this.cy - this.KAPPA * this.ry),
- new Point(this.cx - this.KAPPA * this.rx, this.cy - this.ry),
+ new Point(this.cx - this.rx, this.cy - KAPPA * this.ry),
+ new Point(this.cx - KAPPA * this.rx, this.cy - this.ry),
new Point(this.cx, this.cy - this.ry)
]);
};

Reply all
Reply to author
Forward
0 new messages