mirror of
https://github.com/xibyte/jsketcher
synced 2026-02-17 04:42:39 +01:00
cosmetic changes
This commit is contained in:
parent
e1f0e30004
commit
f33847197b
2 changed files with 9 additions and 4 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue