diff --git a/client/src/components/Ship.vue b/client/src/components/Ship.vue
index f530b6d..f585b88 100644
--- a/client/src/components/Ship.vue
+++ b/client/src/components/Ship.vue
@@ -73,6 +73,7 @@ function onTouchEnd() {
}
onMounted(() => {
+ console.log(props.boat);
document.addEventListener('mousemove', onMouseMove)
document.addEventListener('mouseup', onMouseUp)
document.addEventListener('touchmove', onTouchMove, { passive: false })
@@ -89,8 +90,7 @@ onUnmounted(() => {
const compass = computed(() => {
const hdg = heading.value
- const course = props.boat.course ?? hdg
- const bearing = props.boat.bearing ?? 0
+ const course = props.boat.cog ?? hdg
// ── Compass tape ──────────────────────────────────────────────────────────
const tapeTicks: string[] = []
@@ -114,7 +114,7 @@ const compass = computed(() => {
}
// ── Rose centre & radii ───────────────────────────────────────────────────
- const CX = 100, CY = 158 // moved down from 145
+ const CX = 100, CY = 140 // moved down from 145
const R = 68 // grown from 55
const rudder = Math.max(-30, Math.min(30, ((course - hdg + 540) % 360) - 180))
@@ -125,7 +125,7 @@ const compass = computed(() => {
const cNeedleX = CX + 52 * Math.sin(courseRad)
const cNeedleY = CY - 52 * Math.cos(courseRad)
- const bearRel = ((bearing - hdg + 540) % 360) - 180
+ const bearRel = ((course - hdg + 540) % 360) - 180
const bearRad = bearRel * Math.PI / 180
const bNeedleX = CX + 52 * Math.sin(bearRad)
const bNeedleY = CY - 52 * Math.cos(bearRad)
@@ -151,49 +151,38 @@ const compass = computed(() => {
return `${lbl}`
}).join('')
- // Legend & rudder bar shifted to bottom of taller SVG
- const LEG_Y = 190
-
return `
-