Skip to content

Commit 1041467

Browse files
Merge branch 'feature-canvas-graph'
* feature-canvas-graph: line stoke scales based on screen DPI
2 parents 48aef5a + cfc7ef7 commit 1041467

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

js/tracker.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -601,21 +601,21 @@ function drawAltitudeProfile(c1, c2, alt_list, alt_max) {
601601
c2.attr('width', cw2).attr('height', ch2);
602602

603603
ctx1.fillStyle = "#d6f0f9";
604-
ctx1.lineWidth = 2;
604+
ctx1.lineWidth = 2 * ratio;
605605
ctx1.strokeStyle= "#33B5F5";
606606
ctx2.fillStyle = "#d6f0f9";
607-
ctx2.lineWidth = 2;
607+
ctx2.lineWidth = 2 * ratio;
608608
ctx2.strokeStyle= "#33B5F5";
609609

610610
var xt1 = (cw1 - 2) / alt_list.length;
611611
var yt1 = (ch1 - 6) / alt_max;
612612
var xt2 = (cw2 - 2) / alt_list.length;
613613
var yt2 = (ch2 - 6) / alt_max;
614614

615-
//xt1 = (xt1 > 1) ? 1 : xt1;
616-
//yt1 = (yt1 > 1) ? 1 : yt1;
617-
//xt2 = (xt2 > 1) ? 1 : xt2;
618-
//yt2 = (yt2 > 1) ? 1 : yt2;
615+
xt1 = (xt1 > 1) ? 1 : xt1;
616+
yt1 = (yt1 > 1) ? 1 : yt1;
617+
xt2 = (xt2 > 1) ? 1 : xt2;
618+
yt2 = (yt2 > 1) ? 1 : yt2;
619619

620620
ctx1.beginPath();
621621
ctx1.moveTo(0,c1.height);
@@ -631,8 +631,8 @@ function drawAltitudeProfile(c1, c2, alt_list, alt_max) {
631631
ctx1.stroke();
632632
ctx2.stroke();
633633

634-
ctx1.lineTo(cw1 - 1, ch1);
635-
ctx2.lineTo(cw2 - 1, ch2);
634+
ctx1.lineTo(1+((i+1)*xt1), ch1);
635+
ctx2.lineTo(1+((i+1)*xt2), ch2);
636636

637637
ctx1.closePath();
638638
ctx2.closePath();

0 commit comments

Comments
 (0)