<commit_before>// jshint latedef:nofunc, undef:true, eqnull:true, eqeqeq:true, browser:true, jquery:true, devel:true
/*global prop:true, km:false, crange:false, clamp:false, lpad:false, airport_get:false, game_time:false, game_paused:false, time:false, round:false  */

function canvas_init_pre() {
  "use strict";
  prop.canvas={};

  prop.canvas.contexts={};

  prop.canvas.panY=0;
  prop.canvas.panX=0;

  // resize canvas to fit window?
  prop.canvas.resize=true;
  prop.canvas.size={ // all canvases are the same size
    height:480,
    width:640
  };

  prop.canvas.last = time();
  prop.canvas.dirty = true;
}

function canvas_init() {
  "use strict";
  canvas_add("navaids");
  canvas_add("info");
  canvas_add("aircraft");
  canvas_add("compass");
}

function canvas_adjust_hidpi() {
  "use strict";
  var dpr = window.devicePixelRatio || 1;
  console.log("devicePixelRatio:"+dpr);
  if(dpr > 1) {
    var hidefCanvas = $("#navaids-canvas").get(0);
    var w = $(hidefCanvas).width();
    var h = $(hidefCanvas).height();
    $(hidefCanvas).attr('width', w * dpr);
    $(hidefCanvas).attr('height', h * dpr);
    $(hidefCanvas).css('width', w );
    $(hidefCanvas).css('height', h );
    var ctx = hidefCanvas.getContext("2d");
    ctx.scale(dpr, dpr);
    prop.canvas.contexts.navaids = ctx;
  }
}

function canvas_complete() {
  "use strict";
  setTimeout(function() {<commit_msg>Fix incorrect canvas width and height for hiDPI displays<commit_after>// jshint latedef:nofunc, undef:true, eqnull:true, eqeqeq:true, browser:true, jquery:true, devel:true
/*global prop:true, km:false, crange:false, clamp:false, lpad:false, airport_get:false, game_time:false, game_paused:false, time:false, round:false  */

function canvas_init_pre() {
  "use strict";
  prop.canvas={};

  prop.canvas.contexts={};

  prop.canvas.panY=0;
  prop.canvas.panX=0;

  // resize canvas to fit window?
  prop.canvas.resize=true;
  prop.canvas.size={ // all canvases are the same size
    height:480,
    width:640
  };

  prop.canvas.last = time();
  prop.canvas.dirty = true;
}

function canvas_init() {
  "use strict";
  canvas_add("navaids");
  canvas_add("info");
  canvas_add("aircraft");
  canvas_add("compass");
}

function canvas_adjust_hidpi() {
  "use strict";
  var dpr = window.devicePixelRatio || 1;
  console.log("devicePixelRatio:"+dpr);
  if(dpr > 1) {
    var hidefCanvas = $("#navaids-canvas").get(0);
    var w = prop.canvas.size.width;
    var h = prop.canvas.size.height;
    $(hidefCanvas).attr('width', w * dpr);
    $(hidefCanvas).attr('height', h * dpr);
    $(hidefCanvas).css('width', w );
    $(hidefCanvas).css('height', h );
    var ctx = hidefCanvas.getContext("2d");
    ctx.scale(dpr, dpr);
    prop.canvas.contexts.navaids = ctx;
  }
}

function canvas_complete() {
  "use strict";
  setTimeout(function() {
{'fraction_non_alphanumeric': 0.17049876193845065, 'fraction_numerical': 0.008489564909798374, 'mean_word_length': 4.208103130755064, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5968326', 'n_tokens_mistral': 1043, 'n_tokens_neox': 1018, 'n_words': 202}