summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/models/rect.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/models/rect.js')
-rw-r--r--public/assets/javascripts/rectangles/models/rect.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/public/assets/javascripts/rectangles/models/rect.js b/public/assets/javascripts/rectangles/models/rect.js
index 590440a..500ee6d 100644
--- a/public/assets/javascripts/rectangles/models/rect.js
+++ b/public/assets/javascripts/rectangles/models/rect.js
@@ -107,6 +107,9 @@
Rect.prototype.eq = function(r){
return this.x.eq(r.x) && this.y.eq(r.y)
}
+ Rect.prototype.fits = function(v){
+ return this.x.length() >= v.a && this.y.length() >= v.b
+ }
Rect.prototype.nearEdge = function (x, y, r) {
var edges = 0
if (x < this.x.a+r) {