mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-13 13:17:40 +02:00
[eric] canvas: two same-instant app creations can never fully cover each other; the clash pushes down the column (ENG-346)
This commit is contained in:
@@ -1000,6 +1000,12 @@ const dashboardLayoutSlice = createSlice({
|
||||
posY = pos.y;
|
||||
}
|
||||
}
|
||||
// Two same-instant creations can compute the same spot (the docked sibling is invisible to occupancy); a card must never fully cover another, so push below the column instead.
|
||||
for (;;) {
|
||||
const clash = Object.values(state.viewCards).find((c) => Math.abs(c.x - posX) < 40 && Math.abs(c.y - posY) < 40);
|
||||
if (!clash) break;
|
||||
posY = clash.y + clash.height + GRID_GAP;
|
||||
}
|
||||
const cardKey = viewCardKey(outputId, instance);
|
||||
state.viewCards[cardKey] = {
|
||||
output_id: outputId,
|
||||
|
||||
Reference in New Issue
Block a user