aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2024-08-31 01:10:29 -0700
committerDeterminant <[email protected]>2024-08-31 01:10:29 -0700
commit0d47e96619350957bd7ed1b3e31f1039f763f558 (patch)
treeec1eaa76362a1f1db96c9b3338d61156a0ae8c28
parent0774da0730cddc0be780467d4bd25517e23297a7 (diff)
...
-rwxr-xr-xapp.mjs24
1 files changed, 12 insertions, 12 deletions
diff --git a/app.mjs b/app.mjs
index 464a1d2..15771e5 100755
--- a/app.mjs
+++ b/app.mjs
@@ -457,7 +457,7 @@ const renderAttitudeIndicator = (c, display, values) => {
// draw vertical deflection dots
const pi2 = 2 * Math.PI;
- const vdef_x = w - 10;
+ const vdefX = w - 10 - x0;
const vdefR = 3;
c.strokeStyle = "white";
@@ -465,25 +465,25 @@ const renderAttitudeIndicator = (c, display, values) => {
c.beginPath();
for (let i = -2; i <= 2; i++) {
if (i != 0) {
- const vdef_y = 13 * i;
- c.moveTo(vdef_x + vdefR, vdef_y);
- c.arc(vdef_x, vdef_y, vdefR, 0, pi2);
+ const vdefY = 13 * i;
+ c.moveTo(vdefX + vdefR, vdefY);
+ c.arc(vdefX, vdefY, vdefR, 0, pi2);
}
}
c.stroke();
- if (isNumber(received) && received != 0) {
+ if (isNumber(received) && received == 0) {
// draw CDI diamond
- const cdi_y = 13 * cdi;
- const cdi_h = 7;
- const cdi_w = 4;
+ const cdiY = 13 * cdi;
+ const cdiH = 7;
+ const cdiW = 4;
c.fillStyle = "#2dfe54";
c.strokeStyle = "black";
c.beginPath();
- c.moveTo(vdef_x, cdi_y + cdi_h);
- c.lineTo(vdef_x - cdi_w, cdi_y);
- c.lineTo(vdef_x, cdi_y - cdi_h);
- c.lineTo(vdef_x + cdi_w, cdi_y);
+ c.moveTo(vdefX, cdiY + cdiH);
+ c.lineTo(vdefX - cdiW, cdiY);
+ c.lineTo(vdefX, cdiY - cdiH);
+ c.lineTo(vdefX + cdiW, cdiY);
c.stroke();
c.fill();
}