summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/map/draw.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/map/draw.js')
-rw-r--r--public/assets/javascripts/rectangles/engine/map/draw.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/public/assets/javascripts/rectangles/engine/map/draw.js b/public/assets/javascripts/rectangles/engine/map/draw.js
index cc2f4d8..5824cc8 100644
--- a/public/assets/javascripts/rectangles/engine/map/draw.js
+++ b/public/assets/javascripts/rectangles/engine/map/draw.js
@@ -189,9 +189,25 @@ Map.Draw = function(map, opt){
var sides = map.sides()
var quant = sides.clone().quantize(MAP_GRID_SIZE)
for (var x = quant.x.a - MAP_GRID_SIZE; x <= quant.x.b; x += MAP_GRID_SIZE) {
- line(x, sides.y.a, x, sides.y.b)
+ if (Math.round(x) % 10 == 0) {
+ ctx.strokeStyle = "rgba(0,0,0,0.3)"
+ ctx.lineWidth = 1/map.zoom
+ }
+ else {
+ ctx.strokeStyle = "rgba(0,0,0,0.05)"
+ ctx.lineWidth = 1/map.zoom
+ }
+ line(x, sides.y.a, x, sides.y.b)
}
for (var y = quant.y.a - MAP_GRID_SIZE; y <= quant.y.b; y += MAP_GRID_SIZE) {
+ if (Math.round(y) % 10 == 0) {
+ ctx.strokeStyle = "rgba(0,0,0,0.3)"
+ ctx.lineWidth = 1/map.zoom
+ }
+ else {
+ ctx.strokeStyle = "rgba(0,0,0,0.05)"
+ ctx.lineWidth = 1/map.zoom
+ }
line(sides.x.a, y, sides.x.b, y)
}
}