diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-04-17 12:27:51 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-04-17 12:27:51 -0400 |
| commit | f6424c4756de2045648de0980de14a32b0126df7 (patch) | |
| tree | 844b690dbe722dad6d8eb2869015abacb563a11b /assets/javascripts/rectangles/map/_map.js | |
| parent | 309574dec1852238ae899d719f5486f21949a064 (diff) | |
scale map
Diffstat (limited to 'assets/javascripts/rectangles/map/_map.js')
| -rw-r--r-- | assets/javascripts/rectangles/map/_map.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/assets/javascripts/rectangles/map/_map.js b/assets/javascripts/rectangles/map/_map.js index 833df7a..b0d0b60 100644 --- a/assets/javascripts/rectangles/map/_map.js +++ b/assets/javascripts/rectangles/map/_map.js @@ -8,6 +8,8 @@ var map = new function(){ base.bounds = new vec2(500,500) base.center = new vec2(0,0) + base.zoom = 1/2 + var canvas = document.createElement("canvas") var ctx = window.ctx = canvas.getContext("2d") var w = window.w = canvas.width = 500 @@ -19,6 +21,7 @@ var map = new function(){ map.draw.clear_canvas() map.draw.ruler() + ctx.scale( base.zoom, base.zoom ) ctx.translate( map.center.a + map.bounds.a/2, map.center.b + map.bounds.b/2 ) ctx.scale( -1, 1 ) |
