feat : plan du site (WIP)

This commit is contained in:
2026-02-23 14:56:17 +01:00
parent 4075467465
commit c0417a14c7

View File

@@ -19,7 +19,7 @@
v-for="entry in buildingLayouts" v-for="entry in buildingLayouts"
:key="entry.building.id" :key="entry.building.id"
> >
<div class="font-semibold tracking-wide"> <div class="font-semibold tracking-wide text-primary-500">
{{ entry.building.label || `Bâtiment ${entry.building.id}` }} {{ entry.building.label || `Bâtiment ${entry.building.id}` }}
</div> </div>
@@ -158,7 +158,10 @@ const buildLayoutView = (layout: BuildingLayoutData): {
const cellDrafts: GridCellDraft[] = [] const cellDrafts: GridCellDraft[] = []
// Tri visuel : de haut en bas, puis de gauche à droite // Tri visuel : de haut en bas, puis de gauche à droite
const positionsSorted = [...positions].sort((a, b) => (a.y ?? 1) - (b.y ?? 1) || (a.x ?? 1) - (b.x ?? 1)) const positionsSorted = [...positions].sort(
(leftPosition, rightPosition) =>
(leftPosition.y ?? 1) - (rightPosition.y ?? 1) || (leftPosition.x ?? 1) - (rightPosition.x ?? 1)
)
for (const position of positionsSorted) { for (const position of positionsSorted) {
const x = position.x ?? 1 const x = position.x ?? 1
const y = position.y ?? 1 const y = position.y ?? 1