From c790257286d608cb4669d1d4b669c3f1b36e0603 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Wed, 18 Nov 2026 23:18:46 +0000 Subject: [PATCH] Center docked ships vertically in bank berths --- viewer/src/components/Game.vue | 2 +- viewer/tests/unit/offshore-bank.spec.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/viewer/src/components/Game.vue b/viewer/src/components/Game.vue index 25b2e95..2c4e3ba 100644 --- a/viewer/src/components/Game.vue +++ b/viewer/src/components/Game.vue @@ -1222,7 +1222,7 @@ export default class Game extends Vue { this.ships.push({ id: player.ship.piece.id, x: 373, - y: 660 + pi * 42, + y: 663 + pi * 42, rotate: 90, color, containers: player.ship.containers, diff --git a/viewer/tests/unit/offshore-bank.spec.ts b/viewer/tests/unit/offshore-bank.spec.ts index f1c74bf..e1bc1de 100644 --- a/viewer/tests/unit/offshore-bank.spec.ts +++ b/viewer/tests/unit/offshore-bank.spec.ts @@ -361,8 +361,10 @@ describe('Offshore bank viewer', () => { // A 30×80 ship rotated around (15,40) spans x-25..x+55 and y+25..y+55. expect(ship.x - 25).toBeGreaterThanOrEqual(342); expect(ship.x + 55).toBeLessThanOrEqual(444); - expect(ship.y + 25).toBe(685 + i * 42); - expect(ship.y + 55).toBeLessThan(722 + i * 42); + const berthTop = 684 + i * 42; + const berthBottom = berthTop + 38; + expect(ship.y + 25 - berthTop).toBe(4); + expect(berthBottom - (ship.y + 55)).toBe(4); }); game.destroy(); });