diff options
| author | Julie Lala <jules@okfoc.us> | 2014-05-08 18:09:27 -0400 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-05-08 18:55:54 -0400 |
| commit | 47623b31b6bbd23337920cc51f0ceb623d682139 (patch) | |
| tree | 4f7252e51045c9e890c26bb88e3b9ead32427743 /assets/javascripts/rectangles/models/wall.js | |
| parent | a2288f2f6c7e52ed84bd17598f366c239b61906a (diff) | |
show/hide dots and move them when dragging
Diffstat (limited to 'assets/javascripts/rectangles/models/wall.js')
| -rw-r--r-- | assets/javascripts/rectangles/models/wall.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/assets/javascripts/rectangles/models/wall.js b/assets/javascripts/rectangles/models/wall.js index a9c2fd6..854b238 100644 --- a/assets/javascripts/rectangles/models/wall.js +++ b/assets/javascripts/rectangles/models/wall.js @@ -61,7 +61,9 @@ window.Wall = (function(){ return true } - Wall.prototype.center_for = function(img){ + Wall.prototype.center_for = function(img, offset){ + + offset = offset || 0 var major_axis, minor_axis if (this.side & FRONT_BACK) { @@ -76,18 +78,18 @@ window.Wall = (function(){ switch (this.side) { case FRONT: x = major_axis.midpoint() - z = minor_axis.a + painting_distance_from_wall + z = minor_axis.a + painting_distance_from_wall + offset break case BACK: x = major_axis.midpoint() - z = minor_axis.b - painting_distance_from_wall + z = minor_axis.b - painting_distance_from_wall + offset break case LEFT: - x = minor_axis.a + painting_distance_from_wall + x = minor_axis.a + painting_distance_from_wall + offset z = major_axis.midpoint() break case RIGHT: - x = minor_axis.b - painting_distance_from_wall + x = minor_axis.b - painting_distance_from_wall + offset z = major_axis.midpoint() break } |
