summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/map/tools/position.js
blob: a994f5a63ce717173479224e051b92ad598fd4ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var PositionTool = MapTool.extend(function(base){
	var exports = {
	  recenterCursor: false,
	  drag: function(e, cursor){
      map.center.a = -cursor.x.magnitude()
      map.center.b = cursor.y.magnitude()
	  },
	  rightclick: function(e, cursor){
      cursor.quantize(1/map.zoom)
      map.center.a = cursor.x.a
      map.center.b = -cursor.y.a
      cursor.x.b = cursor.x.a
      cursor.y.b = cursor.y.a
	  }
  }
  return exports
})