summaryrefslogtreecommitdiff
path: root/public/assets/test
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/test')
-rw-r--r--public/assets/test/ortho3.html18
1 files changed, 12 insertions, 6 deletions
diff --git a/public/assets/test/ortho3.html b/public/assets/test/ortho3.html
index 319f788..6bf2619 100644
--- a/public/assets/test/ortho3.html
+++ b/public/assets/test/ortho3.html
@@ -78,6 +78,7 @@ app.off = function(){ app.tube.off.apply(app.tube, arguments) }
var MapTool = Fiber.extend(function(base){
var exports = {
+ recenterCursor: true,
down: function(e, cursor){},
move: function(e, cursor){},
drag: function(e, cursor){},
@@ -136,14 +137,18 @@ var ArrowTool = MapTool.extend(function(base){
var PositionTool = MapTool.extend(function(base){
var exports = {
- down: function(e, cursor){
+ 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
- map.ui.mouse.down = false
- },
+ }
}
return exports
})
@@ -167,7 +172,7 @@ var PolylineTool = MapTool.extend(function (base) {
}
return
}
- map.ui.tools.position.down(e, cursor)
+ map.ui.tools.position.rightclick(e, cursor)
return
}
@@ -216,7 +221,6 @@ var OrthoPolylineTool = MapTool.extend(function (base) {
var exports = {}
exports.down = function(e, cursor){
-
// rightclick?
if (e.ctrlKey || e.which === 3) {
e.preventDefault()
@@ -232,7 +236,9 @@ var OrthoPolylineTool = MapTool.extend(function (base) {
}
return
}
- map.ui.tools.position.down(e, cursor)
+ else {
+ map.ui.tools.position.rightclick(e, cursor)
+ }
return
}