Skip to content

Commit 7f59ff6

Browse files
auto adjust canvas size based on screen DPI
1 parent f3ccdb0 commit 7f59ff6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

js/tracker.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,11 @@ function drawAltitudeProfile(c1, c2, alt_list, alt_max) {
591591
c1 = $(c1);
592592
c2 = $(c2);
593593

594-
var cw1 = 150;
595-
var ch1 = 40;
596-
var cw2 = 60;
597-
var ch2 = 40;
594+
var ratio = window.devicePixelRatio;
595+
var cw1 = 150 * ratio;
596+
var ch1 = 40 * ratio;
597+
var cw2 = 60 * ratio;
598+
var ch2 = 40 * ratio;
598599

599600
c1.attr('width', cw1).attr('height', ch1);
600601
c2.attr('width', cw2).attr('height', ch2);

0 commit comments

Comments
 (0)