From 26257fe13e027cf65d30a11c5febd4a6da455a30 Mon Sep 17 00:00:00 2001 From: Thomas Richter Date: Wed, 17 Dec 2025 04:14:40 +0100 Subject: [PATCH] Fix deck border alignment with plank edges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Calculate deck edges accounting for plank height - Border now aligns with top of first plank and bottom of last plank - Proper vertical centering of border rectangle 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/scenes/ShipDeckScene.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scenes/ShipDeckScene.js b/src/scenes/ShipDeckScene.js index e1e4548..217a9bb 100644 --- a/src/scenes/ShipDeckScene.js +++ b/src/scenes/ShipDeckScene.js @@ -59,8 +59,13 @@ export default class ShipDeckScene extends Phaser.Scene { } // Draw border around deck - const deckHeight = this.deckBottomY - this.deckTopY + 25; // +25 for last plank height - const deckBorder = this.add.rectangle(this.deckCenterX, this.deckTopY + (deckHeight / 2), this.deckWidth, deckHeight); + const plankHeight = 25; + const deckTopEdge = this.deckTopY - (plankHeight / 2); + const deckBottomEdge = this.deckBottomY + (plankHeight / 2); + const deckHeight = deckBottomEdge - deckTopEdge; + const deckCenterY = (deckTopEdge + deckBottomEdge) / 2; + + const deckBorder = this.add.rectangle(this.deckCenterX, deckCenterY, this.deckWidth, deckHeight); deckBorder.setStrokeStyle(4, 0x3d2817); deckBorder.setFillStyle(0x000000, 0); // Transparent fill }