diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-08-27 12:44:17 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-08-27 12:44:17 -0400 |
| commit | 464bd3bfe74695955239e176dce8fe885bba8ac3 (patch) | |
| tree | cab1f79d312abdb4697ad822949597e64b46943d /public/assets/javascripts/rectangles/engine/shapes/ortho.js | |
| parent | 685d5fd7b32ac868a0b2d8ac8a2a1b4120f274cf (diff) | |
arrow tool can translate walls orthogonally
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/shapes/ortho.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/shapes/ortho.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/public/assets/javascripts/rectangles/engine/shapes/ortho.js b/public/assets/javascripts/rectangles/engine/shapes/ortho.js index 8a8f928..c1acae5 100644 --- a/public/assets/javascripts/rectangles/engine/shapes/ortho.js +++ b/public/assets/javascripts/rectangles/engine/shapes/ortho.js @@ -33,6 +33,22 @@ var OrthoPolyline = Polyline.extend(function(base){ } } } + exports.translateSegment = function(src, dest, dx, dy) { + if (src[0].a == src[1].a) { + dest[0].a = src[0].a + dx + dest[1].a = src[1].a + dx + if (src.length == 3) { + dest[2].a = src[2].a + dx + } + } + else { + dest[0].b = src[0].b + dy + dest[1].b = src[1].b + dy + if (src.length == 3) { + dest[2].b = src[2].b + dy + } + } + } exports.close = function(){ this.points[this.points.length] = this.points[0] this.closed = true |
