diff options
Diffstat (limited to 'rectangles.html')
| -rw-r--r-- | rectangles.html | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/rectangles.html b/rectangles.html index 8878985..b6f4ca9 100644 --- a/rectangles.html +++ b/rectangles.html @@ -32,7 +32,7 @@ vec2.prototype.length = function(){ vec2.prototype.clone = function(){ return new vec2(this.a, this.b) } -vec2.prototype.normalize = function(){ +vec2.prototype.abs = function(){ if (this.b < this.a) { this.a = this.a ^ this.b this.b = this.a ^ this.b @@ -99,8 +99,8 @@ rect.prototype.center = function(){ return new vec2(this.x.midpoint(), this.y.midpoint()) } rect.prototype.normalize = function(){ - this.x.normalize().add(this.translation.a) - this.y.normalize().add(this.translation.b) + this.x.abs().add(this.translation.a) + this.y.abs().add(this.translation.b) this.translation.a = this.translation.b = 0 return this } @@ -149,7 +149,6 @@ canvas.addEventListener("mousedown", function(e){ else { creating = true } - }) canvas.addEventListener("mousemove", function(e){ mouse.x.b = e.pageX |
