Skip to content

Commit 5d9a565

Browse files
author
tom
committed
Fix surbrillances deplacement alignees sur tuiles composees.
highlight_design_size() = tailles board_composed (27/28/22/24/14 px).
1 parent fde2159 commit 5d9a565

3 files changed

Lines changed: 25 additions & 31 deletions

File tree

godot/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ Format des entrées : `AAAA-MM-JJ HH:MM:SS` (heure locale, fuseau du commit Git
88

99
---
1010

11+
## 2026-05-25 (nuit) — Surbrillances déplacements alignées sur les tuiles
12+
13+
**Problème** : rectangles de surbrillance / sélection trop grands (31×31 îles, connecteurs mer jusqu’à 46 px) → chevauchements en « pâtés » sur la grille.
14+
15+
**Correction** :
16+
- **`highlight_design_size()`** dans `board_atlas.gd` — mêmes tailles que `compose_board_from_tiles.py` (îles 27, HQ 28, Moons 22, Sun 24, Space 14)
17+
- **`board_map.gd`**`_hit_rect` utilise uniquement ces dimensions (suppression des `r × 2` / `r × 3.5`)
18+
19+
**Tests** : `.\tools\run_headless.ps1 -Mode smoke` — OK.
20+
21+
---
22+
1123
## 2026-05-25 (soir) — Carte Unity complète : îles, couloirs bordure, croix centrale
1224

1325
**Référence** : captures `Screenshot_20260525-000216_Forc2.jpg` / `000226` ; structure `Dep_mer.js` + `filtre_case_name.js`.

godot/scripts/battle/board_map.gd

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,11 @@ func _sector_center(board: Rect2, sx: float, sy: float, sector_id: String) -> Ve
154154
)
155155

156156

157-
func _hit_rect(board: Rect2, sx: float, sy: float, sc: float, sector_id: String) -> Rect2:
157+
func _hit_rect(board: Rect2, sx: float, sy: float, _sc: float, sector_id: String) -> Rect2:
158158
var center := _sector_center(board, sx, sy, sector_id)
159-
var d: Dictionary = _layout[sector_id] as Dictionary
160-
var design := BoardAtlas.tile_design_size(sector_id)
161-
var w: float = design.x * sc
162-
var h: float = design.y * sc
163-
if sector_id.begins_with("HQ_"):
164-
w = maxf(w, float(d.get("r", 13)) * sc * 2.2)
165-
h = w
166-
elif sector_id.begins_with("Space_") or BoardCatalog.is_neutral(sector_id):
167-
w = maxf(w, float(d.get("r", 8)) * sc * 3.5)
168-
h = maxf(h, float(d.get("r", 8)) * sc * 3.5)
169-
else:
170-
w = maxf(w, float(d.get("r", 11)) * sc * 2.0)
171-
h = maxf(h, float(d.get("r", 11)) * sc * 2.0)
159+
var design := BoardAtlas.highlight_design_size(sector_id)
160+
var w: float = design.x * sx
161+
var h: float = design.y * sy
172162
return Rect2(center - Vector2(w, h) * 0.5, Vector2(w, h))
173163

174164

godot/scripts/core/board_atlas.gd

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -163,29 +163,21 @@ static func tile_native_size(sector_id: String) -> Vector2:
163163
return Vector2(float(sz.x), float(sz.y))
164164

165165

166-
static func tile_design_size(sector_id: String) -> Vector2:
166+
## Tailles des tuiles sur board_composed.png (compose_board_from_tiles.py).
167+
static func highlight_design_size(sector_id: String) -> Vector2:
167168
if sector_id.begins_with("Space_"):
168-
return _sea_connector_design_size(sector_id)
169+
return Vector2(14.0, 14.0)
169170
if sector_id.begins_with("HQ_"):
170-
return Vector2(34.0, 34.0)
171+
return Vector2(28.0, 28.0)
171172
if sector_id == "Sun":
172-
return Vector2(32.0, 32.0)
173+
return Vector2(24.0, 24.0)
173174
if sector_id.begins_with("Moon_"):
174-
return Vector2(26.0, 26.0)
175-
return Vector2(31.0, 31.0)
175+
return Vector2(22.0, 22.0)
176+
return Vector2(27.0, 27.0)
176177

177178

178-
static func _sea_connector_design_size(sector_id: String) -> Vector2:
179-
var native := tile_native_size(sector_id)
180-
if native.x < 1.0 or native.y < 1.0:
181-
return Vector2(24.0, 24.0)
182-
if native.x > native.y * 1.35:
183-
var w := 46.0
184-
return Vector2(w, maxf(10.0, w * native.y / native.x))
185-
if native.y > native.x * 1.35:
186-
var h := 46.0
187-
return Vector2(maxf(10.0, h * native.x / native.y), h)
188-
return Vector2(24.0, 24.0)
179+
static func tile_design_size(sector_id: String) -> Vector2:
180+
return highlight_design_size(sector_id)
189181

190182

191183
static func _camp_multiply_color(camp: GameConstants.Camp) -> Color:

0 commit comments

Comments
 (0)