[#278] Plan du site #33
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user