Skip to content

Commit

Permalink
Merge pull request #1 from zlsa/gh-pages
Browse files Browse the repository at this point in the history
Sync
  • Loading branch information
AlexMcArrow committed Jun 18, 2015
2 parents 0cf66ad + f059f28 commit 6a928cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/scripts/aircraft.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ var Aircraft=Fiber.extend(function() {
this.html.click(this, function(e) {
input_select(e.data.getCallsign());
});

this.html.dblclick(this, function (e) {
prop.canvas.panX = 0 - round(km(e.data.position[0]));
prop.canvas.panY = round(km(e.data.position[1]));
prop.canvas.dirty = true;
});

},
cleanup: function() {
Expand Down
4 changes: 4 additions & 0 deletions assets/scripts/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
function ui_init_pre() {
prop.ui = {};
prop.ui.scale_default = 8; // pixels per km
prop.ui.scale_max = 80; // max scale
prop.ui.scale_min = 1; // min scale
prop.ui.scale = prop.ui.scale_default;

if('atc-scale' in localStorage) prop.ui.scale = localStorage['atc-scale'];
}

function ui_zoom_out() {
prop.ui.scale *= 0.9;
if(prop.ui.scale < prop.ui.scale_min) prop.ui.scale = prop.ui.scale_min;
ui_after_zoom();
}

function ui_zoom_in() {
prop.ui.scale /= 0.9;
if(prop.ui.scale > prop.ui.scale_max) prop.ui.scale = prop.ui.scale_max;
ui_after_zoom();
}

Expand Down

0 comments on commit 6a928cf

Please sign in to comment.