summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/map/draw.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-02-04 14:04:48 -0500
committerJules Laplace <jules@okfoc.us>2015-02-04 14:04:48 -0500
commit24c2c9bd7b776c49e5e90caef00c99bc008ac72a (patch)
tree08d030facc66ecca1c5274a717abd2e49fa4954b /public/assets/javascripts/rectangles/engine/map/draw.js
parent4c7cad2ebfc44244ba845c1574271e48b9f2b740 (diff)
separate orbit test & add mousewheel zoom
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/map/draw.js')
-rw-r--r--public/assets/javascripts/rectangles/engine/map/draw.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/public/assets/javascripts/rectangles/engine/map/draw.js b/public/assets/javascripts/rectangles/engine/map/draw.js
index b525696..564b351 100644
--- a/public/assets/javascripts/rectangles/engine/map/draw.js
+++ b/public/assets/javascripts/rectangles/engine/map/draw.js
@@ -228,7 +228,7 @@ Map.Draw = function(map, opt){
line(r.x.a, r.y.a, r.x.b, r.y.b, r.translation)
}
- function dot_at (x,z){
+ draw.dot_at = function dot_at (x,z){
ctx.save()
ctx.translate(x,z)
@@ -240,4 +240,23 @@ Map.Draw = function(map, opt){
ctx.restore()
}
+
+ draw.x_at = function x_at (x, z, length){
+ ctx.save()
+ ctx.translate(x,z)
+
+ var len = (length/2 || 4) / map.zoom
+
+ ctx.lineCap = "square"
+ ctx.lineWidth = 2/map.zoom
+ ctx.beginPath()
+ ctx.moveTo( -len, -len);
+ ctx.lineTo( len, len);
+ ctx.moveTo( -len, len);
+ ctx.lineTo( len, -len);
+ ctx.stroke();
+
+ ctx.restore()
+ }
+
} \ No newline at end of file