cosmetic changes

This commit is contained in:
Val Erastov 2014-10-10 00:48:32 -07:00
parent e1f0e30004
commit f33847197b
2 changed files with 9 additions and 4 deletions

View file

@ -7,7 +7,7 @@ TCAD.TWO.Arc = function(a, b, c) {
a.parent = this;
b.parent = this;
c.parent = this;
this.r = new TCAD.TWO.Ref();
this.r = new TCAD.TWO.Ref(0);
};
TCAD.TWO.utils.extend(TCAD.TWO.Arc, TCAD.TWO.SketchObject);
@ -37,6 +37,11 @@ TCAD.TWO.Arc.prototype.translateImpl = function(dx, dy) {
this.c.translate(dx, dy);
};
TCAD.TWO.Arc.prototype.radiusForDrawing = function() {
return this.distanceA();
};
TCAD.TWO.Arc.prototype.distanceA = function() {
return TCAD.math.distance(this.a.x, this.a.y, this.c.x, this.c.y);
};
@ -47,7 +52,7 @@ TCAD.TWO.Arc.prototype.distanceB = function() {
TCAD.TWO.Arc.prototype.drawImpl = function(ctx, scale) {
ctx.beginPath();
var r = this.distanceA();
var r = this.radiusForDrawing();
ctx.arc(this.c.x, this.c.y, r,
Math.atan2(this.a.y - this.c.y, this.a.x - this.c.x),
Math.atan2(this.b.y - this.c.y, this.b.x - this.c.x));

View file

@ -299,9 +299,9 @@ TCAD.TWO.SketchObject.prototype.draw = function(ctx, scale) {
if (this.marked) ctx.restore();
};
TCAD.TWO.Ref = function() {
TCAD.TWO.Ref = function(value) {
this.id = TCAD.TWO.utils.genID();
this.value = 0;
this.value = value;
};
TCAD.TWO.Ref.prototype.set = function(value) {