Fix deck border alignment with plank edges

- 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 <noreply@anthropic.com>
This commit is contained in:
Thomas Richter
2025-12-17 04:14:40 +01:00
parent bb3b2f8b3b
commit 26257fe13e

View File

@@ -59,8 +59,13 @@ export default class ShipDeckScene extends Phaser.Scene {
} }
// Draw border around deck // Draw border around deck
const deckHeight = this.deckBottomY - this.deckTopY + 25; // +25 for last plank height const plankHeight = 25;
const deckBorder = this.add.rectangle(this.deckCenterX, this.deckTopY + (deckHeight / 2), this.deckWidth, deckHeight); 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.setStrokeStyle(4, 0x3d2817);
deckBorder.setFillStyle(0x000000, 0); // Transparent fill deckBorder.setFillStyle(0x000000, 0); // Transparent fill
} }