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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user